-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
executable file
·42 lines (40 loc) · 1.09 KB
/
webpack.config.js
File metadata and controls
executable file
·42 lines (40 loc) · 1.09 KB
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
var webpack = require('webpack');
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin')
var ROOT_PATH = path.resolve(__dirname);
var APP_PATH = path.resolve(ROOT_PATH, 'src');
var BUILD_PATH = path.resolve(ROOT_PATH, 'dist');
module.exports = {
context: APP_PATH,
entry: [
"babel-polyfill",
"./index.js"
],
output: {
path: BUILD_PATH,
publicPath: process.env.NODE_ENV === 'production' ? "" : "http://localhost:8080/",
filename: "bundle.js"
},
devtool: 'source-map',
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader"
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
loader: 'file-loader'
},
{
test: /\.scss$/,
loaders: ["style", "css", "sass"]
}
]
},
plugins: [new HtmlWebpackPlugin({
template: "./index.ejs"
})]
};