-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
32 lines (31 loc) · 985 Bytes
/
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
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin');
const packageJSON = require("./package.json");
const path = require("path");
const BUILD_PATH = path.join(__dirname, 'target', 'classes', 'META-INF', 'resources', 'webjars', packageJSON.name, packageJSON.version);
module.exports = {
output: {
path: BUILD_PATH,
libraryTarget: "var",
library: "Application"
},
module: {
rules: [ {
test: /\.css$/,
use: [ {loader: 'style-loader'}, {loader: 'css-loader'}]
}, {
test: /\.(gif|png|jpe?g|svg)$/i,
use: [ {loader: 'url-loader?prefix=&limit=5000000'} ]
}, {
test: /\.(html)$/,
use: [ {loader: 'html-loader'} ]
}
]
},
plugins: [
new UglifyJsPlugin(),
new HtmlWebpackPlugin({template: 'src/index.html', inject: 'head', inlineSource: '.(js)$'}),
new HtmlWebpackInlineSourcePlugin()
]
}