1 | var webpack = require('webpack');
|
2 | var path = require('path')
|
3 | var HtmlWebpackPlugin = require('html-webpack-plugin');
|
4 | var uglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
|
5 |
|
6 | var HtmlWebpackConfig = {
|
7 | title: 'live2d',
|
8 | filename: 'index.html',
|
9 | template: "./src/index.html",
|
10 | hash: true,
|
11 | showErrors: true
|
12 | };
|
13 |
|
14 | module.exports = {
|
15 | entry: [
|
16 | "./src/main.js"
|
17 | ],
|
18 | output: {
|
19 | filename: "bundle.js",
|
20 | path: __dirname + "/dist"
|
21 | },
|
22 |
|
23 | devtool: "source-map",
|
24 |
|
25 | plugins: [
|
26 | new HtmlWebpackPlugin(HtmlWebpackConfig),
|
27 | new webpack.optimize.UglifyJsPlugin({ sourceMap: true })
|
28 | ],
|
29 |
|
30 | resolve: {
|
31 | extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js"]
|
32 | },
|
33 |
|
34 | module: {
|
35 | rules: [
|
36 | {
|
37 | test: /\.js$/,
|
38 | exclude: path.resolve(__dirname, "node_modules"),
|
39 | use: [{
|
40 | loader: 'babel-loader',
|
41 | query: {
|
42 | presets: ["env"]
|
43 | }
|
44 | }],
|
45 | }
|
46 | ]
|
47 | }
|
48 | } |
\ | No newline at end of file |