-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.js
37 lines (35 loc) · 895 Bytes
/
webpack.common.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
'use strict';
const path = require('path');
const webpack = require('webpack');
const { VueLoaderPlugin } = require('vue-loader');
const CopyPlugin = require('copy-webpack-plugin');
const config = require('config');
module.exports = {
resolve: { alias: { src: path.resolve(__dirname, 'src') } },
entry: ['./src/index.js'],
module: {
rules: [
{
test: /\.vue$/,
use: 'vue-loader',
},
{
test: /\.css$/,
use: ['vue-style-loader', 'css-loader'],
},
{
test: /\.less$/,
use: ['vue-style-loader', 'css-loader', 'less-loader'],
},
],
},
plugins: [
new VueLoaderPlugin(),
new CopyPlugin({ patterns: [{ from: './assets', to: './' }] }),
new webpack.DefinePlugin({ CONFIG: JSON.stringify(config) }),
],
output: {
filename: '[name].js',
chunkFilename: '[name].bundle.js',
},
};