【发布时间】:2020-06-14 15:44:55
【问题描述】:
每当我执行npm run watch 时,第一次编译工作正常 - 但经过几次编译后,我最终会收到此错误:
95% 发出未命名的兼容插件错误:未知:未知错误,打开 'D:\Laragon\www\erproj\public\js\app.js'
const mix = require('laravel-mix')
require('laravel-vue-lang/mix')
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('resources/js/app.js', 'public/js')
mix.webpackConfig(
{
module:
{
rules:
[
{
enforce: 'pre',
exclude: /node_modules/,
loader: 'eslint-loader',
test: /\.(js|vue)?$/
},
]
}
})
mix.webpackConfig(
{
module:
{
rules:
[
{
test: /\.scss$/,
use:
[
{
loader: 'sass-loader'
},
{
loader: 'sass-resources-loader',
options:
{
resources: './resources/sass/_*.scss'
}
}
]
}
]
}
})
mix.webpackConfig(
{
resolve:
{
alias:
{
'@': path.resolve('./resources/js'),
'~': path.resolve('./resources/')
}
}
})
mix.webpackConfig(
{
resolve:
{
alias:
{
'vue$': 'vue/dist/vue.js'
}
}
})
mix.webpackConfig(
{
resolve:
{
alias:
{
'@lang': path.resolve('./resources/lang'),
},
},
module:
{
rules:
[
{
test: /resources[\\/]lang.+\.(php|json)$/,
loader: 'laravel-localization-loader',
},
],
},
})
我通过谷歌来回搜索,没有找到可行的解决方案。 感谢您的帮助。
【问题讨论】: