我尝试通过webpack管理所有需要的软件包,并且使用sass(从互联网学习后如何操作)。但我无法弄清楚为什么它不适用于帕格和eslint。 eslint有错误,没有找到.eslintrc文件,是的,它不在根文件夹中。但我在eslint词典中找到了两个。我是否必须将.eslintrc.json / .js复制到根目录中? 帕格不会给我任何错误,webpack只是为了他的工作。
的package.json
...
"scripts": {
"build": "pug-lint && webpack-dev-server"
},
...
webpack.config.js
var htmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
// define entry point
entry: './js/script1.js',
// define output point
output: {
path: 'dist',
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.scss$/,
loader: 'style-loader!css-loader!sass-loader'
},
{
test: /\.pug$/,
loader: 'pug',
exclude: /layout/
}
]
},
eslint: {
failOnWarning: false,
failOnError: true
},
devServer: {
contentBase: './dist/',
inline: true,
stats: 'errors-only'
},
plugins: [
new htmlWebpackPlugin({
template: './src/index.html',
hash: true
})
]
};