-
-
Notifications
You must be signed in to change notification settings - Fork 162
/
Copy pathwebpack.config.js
47 lines (45 loc) · 1.19 KB
/
webpack.config.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
const { VueLoaderPlugin } = require('vue-loader');
const WebpackShellPlugin = require('webpack-shell-plugin');
const Dotenv = require('dotenv-webpack');
module.exports = {
entry: "./src/main.js",
output: {
path: __dirname,
filename: 'main.js',
libraryTarget: "commonjs2"
},
devtool: "none", // prevent webpack from using eval() on my module
externals: {
uxp: "uxp",
application: 'application',
scenegraph: "scenegraph",
commands: "commands"
},
resolve: {
alias: {
'@': (__dirname + '/src'),
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: "vue-loader"
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
}
]
},
plugins: [
new VueLoaderPlugin(),
new WebpackShellPlugin({
onBuildStart: ['echo "Build Starts"'],
onBuildEnd: ['node ./src/script/reload-xd-plugin.js']
}),
new Dotenv({
path: process.env.NODE_ENV === 'development' ? './development.env' : './production.env'
})
]
};