forked from sas-fossdev/saspes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.js
52 lines (51 loc) · 1.63 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');
const helpers = require('./webpack-helpers.js');
const { VueLoaderPlugin } = require('vue-loader');
const webpack = require('webpack');
module.exports = {
entry: {
'js/saspowerschoolff': path.join(__dirname, 'src', 'js', 'saspowerschoolff.js'),
'js/background': path.join(__dirname, 'src', 'js', 'background.js'),
'ui/options': path.join(__dirname, 'src', 'ui', 'options.js'),
'ui/historygrades': path.join(__dirname, 'src', 'ui', 'historygrades.js')
},
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '/js/'
},
module: {
rules: [
{
test: /\.less$/,
use: ['vue-style-loader', 'css-loader', 'less-loader']
},
{
test: /\.css$/,
use: ['vue-style-loader', 'css-loader']
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}
]
},
plugins: [
new CopyPlugin([
{ from: "src", to: '', ignore: ['*.js', 'js/**', 'manifest.json', 'manifest - chromium.json', '.eslintrc.json']}
]),
new VueLoaderPlugin(),
new webpack.DefinePlugin({
"SASPES_VERSION_NAME": JSON.stringify(helpers.versionName()),
"SASPES_IS_OFFICIAL_RELEASE": helpers.isRelease(),
})
],
resolve: {
extensions: ['.js', '.vue']
}
};