-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.cjs
57 lines (56 loc) · 1.26 KB
/
webpack.config.cjs
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
53
54
55
56
57
const path = require('path');
const CopyPlugin = require("copy-webpack-plugin");
const { VueLoaderPlugin } = require('vue-loader');
const webpack = require("webpack")
module.exports = env => ({
mode: env.mode,
devtool: 'inline-cheap-module-source-map',
resolve: {
extensions: ['.js', '.ts', '.json'],
},
entry: {
service: path.resolve(__dirname, 'extension', 'service.ts'),
app: path.resolve(__dirname, 'extension', 'main.ts'),
sandbox: path.resolve(__dirname, 'extension', 'sandbox.ts')
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'extension', 'build'),
},
module: {
rules: [
{
test: /\.vue$/,
use: 'vue-loader'
},
{
test: /\.css$/,
use: 'css-loader'
},
{
test: /\.ts$/,
exclude: /node_modules/,
use: {
loader: 'ts-loader',
options: {
appendTsSuffixTo: [/\.vue$/]
}
}
},
]
},
plugins: [
new CopyPlugin({
patterns: [
{
from: path.resolve(__dirname, 'extension', 'public')
},
]
}),
new VueLoaderPlugin(),
new webpack.DefinePlugin({
__VUE_PROD_DEVTOOLS__: false,
__VUE_OPTIONS_API__: true
})
],
});