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']
|
|
|
|
},
|
|
|
|
{
|
2019-10-27 10:35:20 +00:00
|
|
|
test: /src\/.*\.(js|vue)$/,
|
2018-08-30 20:22:27 +00:00
|
|
|
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$/,
|
2019-05-11 12:57:18 +00:00
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
plugins: [
|
|
|
|
'@babel/plugin-syntax-dynamic-import',
|
|
|
|
'@babel/plugin-proposal-object-rest-spread'
|
|
|
|
],
|
|
|
|
presets: ['@babel/preset-env']
|
|
|
|
}
|
|
|
|
},
|
|
|
|
exclude: /node_modules\/(?!(p-limit|p-defer|p-queue|p-try|cdav-library))/
|
2018-08-19 20:18:53 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
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({
|
2019-09-05 21:08:45 +00:00
|
|
|
$appVersion: JSON.stringify(require('./package.json').version)
|
2019-03-26 19:39:48 +00:00
|
|
|
})
|
|
|
|
],
|
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
|
|
|
}
|