-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
43 lines (43 loc) · 1.2 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
import webpack from "webpack";
import HtmlWebpackPlugin from "html-webpack-plugin";
import CopyPlugin from "copy-webpack-plugin";
import path, {dirname} from "path";
import {fileURLToPath} from "url";
const directory = dirname(fileURLToPath(import.meta.url));
export default {
mode: 'development',
entry: './src/webapp/index.js',
output: {
path: path.resolve(directory, 'dist/webapp'),
filename: 'webapp.bundle.js',
},
plugins: [
new HtmlWebpackPlugin({ template: './src/webapp/index.html' }),
new CopyPlugin({
patterns: [
{ from: "src/webapp/images", to: "images" }
],
}),
],
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
},
resolve: {
alias: {
//'vue$': 'vue/dist/vue.cjs.js',
//'axios$': 'axios/dist/axios.js',
},
extensions: ['*', '.js','.json']
}
};