-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
41 lines (39 loc) · 1.16 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
let path = require("path");
let BundleTracker = require('webpack-bundle-tracker');
let ExtractTextPlugin = require('extract-text-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
context: __dirname,
entry: {
'party': ['./assets/js/party'],
'index': ['./assets/js/index'],
},
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{test: /\.ts$/, loader: 'ts-loader'},
{test: /\.(mp3|mp4|png|woff2?)$/, loader: "file-loader"},
{test: /\.txt$/, loader: "raw-loader"},
{test: /\.css$/, use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader",
})},
],
},
externals: {
'page-data': '_pageData',
},
plugins: [
new BundleTracker({filename: './webpack-stats.json'}),
new ExtractTextPlugin("[name]-[hash].css"),
new UglifyJsPlugin({sourceMap: true}),
],
devtool: "sourcemap",
output: {
filename: "[name]-[hash].js",
path: path.resolve("./bundles/"),
publicPath: "/static/"
}
};