2020-09-08 14:52:31 +00:00
|
|
|
const path = require('path');
|
|
|
|
const VueLoaderPlugin = require('vue-loader/lib/plugin');
|
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
|
const autoprefixer = require('autoprefixer');
|
2019-06-03 03:31:38 +00:00
|
|
|
|
2020-09-08 14:52:31 +00:00
|
|
|
module.exports = {
|
2020-05-14 02:26:05 +00:00
|
|
|
entry: './assets/js/main.js',
|
|
|
|
output: {
|
|
|
|
filename: 'bundle.js',
|
|
|
|
path: path.join(__dirname, 'public/js'),
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.vue$/,
|
|
|
|
include: [
|
|
|
|
path.resolve(__dirname, 'assets'),
|
|
|
|
],
|
|
|
|
loader: 'vue-loader',
|
|
|
|
options: {
|
|
|
|
preserveWhitespace: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
babelrc: false,
|
|
|
|
plugins: [
|
|
|
|
'@babel/plugin-proposal-object-rest-spread',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'eslint-loader',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
|
|
|
use: [
|
|
|
|
MiniCssExtractPlugin.loader,
|
|
|
|
'css-loader?sourceMap',
|
|
|
|
{
|
|
|
|
loader: 'postcss-loader',
|
|
|
|
options: {
|
|
|
|
plugins: [autoprefixer],
|
|
|
|
sourceMap: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'sass-loader?sourceMap',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.svg/,
|
|
|
|
use: 'raw-loader',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new VueLoaderPlugin(),
|
|
|
|
new MiniCssExtractPlugin({
|
|
|
|
filename: '../css/style.css',
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
theme: path.join(__dirname, 'assets/css/_theme.scss'),
|
2020-07-05 02:40:57 +00:00
|
|
|
breakpoints: path.join(__dirname, 'assets/css/_breakpoints.scss'),
|
2020-05-14 02:26:05 +00:00
|
|
|
config: path.join(__dirname, `assets/js/config/${process.env.NODE_ENV || 'default'}.js`),
|
|
|
|
},
|
|
|
|
},
|
2019-06-03 03:31:38 +00:00
|
|
|
};
|