运行gulp时会报以下错误:
[07:11:05] gulp-notify: [Laravel Elixir] Browserify Failed!: Parsing file /home/vagrant/Code/TaskManager/resources/assets/js/vue/components/stepList.vue: 'import' and 'export' may appear only with 'sourceType: module' (22:0)
{ Error: Parsing file /home/vagrant/Code/TaskManager/resources/assets/js/vue/components/stepList.vue: 'import' and 'export' may appear only with 'sourceType: module' (22:0)
at Deps.parseDeps (/home/vagrant/Code/TaskManager/node_modules/module-deps/index.js:437:28)
at fromSource (/home/vagrant/Code/TaskManager/node_modules/module-deps/index.js:376:44)
at /home/vagrant/Code/TaskManager/node_modules/module-deps/index.js:370:17
at ConcatStream. (/home/vagrant/Code/TaskManager/node_modules/concat-stream/index.js:36:43)
at emitNone (events.js:91:20)
at ConcatStream.emit (events.js:185:7)
at finishMaybe (/home/vagrant/Code/TaskManager/node_modules/readable-stream/lib/_stream_writable.js:460:14)
at endWritable (/home/vagrant/Code/TaskManager/node_modules/readable-stream/lib/_stream_writable.js:469:3)
at ConcatStream.Writable.end (/home/vagrant/Code/TaskManager/node_modules/readable-stream/lib/_stream_writable.js:436:5)
at DuplexWrapper.onend (/home/vagrant/Code/TaskManager/node_modules/readable-stream/lib/_stream_readable.js:537:10)
.vue文件代码如下:
{{ step.name }}
请问这是什么回事?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
在根目录新建 .babelrc 输入一下内容