guests/webpack.common.js

54 строки
1023 B
JavaScript

const path = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const StyleLintPlugin = require('stylelint-webpack-plugin')
module.exports = {
entry: {
main: path.join(__dirname, 'src', 'index.js'),
settings: path.join(__dirname, 'src', 'settings.js')
},
output: {
path: path.resolve(__dirname, './js'),
publicPath: '/js/',
filename: '[name].js'
},
module: {
rules: [
{
test: /\.css$/,
use: ['vue-style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['vue-style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.(js|vue)$/,
use: 'eslint-loader',
enforce: 'pre'
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
}
]
},
plugins: [
new VueLoaderPlugin(),
new StyleLintPlugin({
files: ['src/**/*.vue', 'src/**/*.scss', 'src/**/*.css']
})
],
resolve: {
extensions: ['*', '.js', '.vue'],
symlinks: false
}
}