2018-11-02 21:20:56 +00:00
|
|
|
const path = require('path')
|
|
|
|
const webpack = require('webpack')
|
|
|
|
const { VueLoaderPlugin } = require('vue-loader')
|
|
|
|
const StyleLintPlugin = require('stylelint-webpack-plugin')
|
2018-08-19 20:18:53 +00:00
|
|
|
|
|
|
|
module.exports = {
|
2018-11-02 21:20:56 +00:00
|
|
|
entry: path.join(__dirname, 'src', 'main.js'),
|
2018-08-19 20:18:53 +00:00
|
|
|
output: {
|
2018-08-30 20:22:27 +00:00
|
|
|
path: path.resolve(__dirname, './js'),
|
|
|
|
publicPath: '/js/',
|
|
|
|
filename: 'tasks.js'
|
2018-08-19 20:18:53 +00:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
2018-08-30 20:22:27 +00:00
|
|
|
{
|
|
|
|
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'
|
|
|
|
},
|
2018-08-19 20:18:53 +00:00
|
|
|
{
|
|
|
|
test: /\.vue$/,
|
2018-08-30 20:22:27 +00:00
|
|
|
loader: 'vue-loader'
|
2018-08-19 20:18:53 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
loader: 'babel-loader',
|
|
|
|
exclude: /node_modules/
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(png|jpg|gif|svg)$/,
|
|
|
|
loader: 'file-loader',
|
|
|
|
options: {
|
|
|
|
name: '[name].[ext]?[hash]'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2019-03-26 19:39:48 +00:00
|
|
|
plugins: [
|
|
|
|
new VueLoaderPlugin(),
|
|
|
|
new StyleLintPlugin(),
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
appVersion: JSON.stringify(require('./package.json').version)
|
|
|
|
})
|
|
|
|
],
|
2018-08-19 20:18:53 +00:00
|
|
|
resolve: {
|
2018-08-30 20:22:27 +00:00
|
|
|
extensions: ['*', '.js', '.vue', '.json']
|
|
|
|
}
|
2018-11-02 21:20:56 +00:00
|
|
|
}
|