-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
40 lines (32 loc) · 1.03 KB
/
webpack.config.js
File metadata and controls
40 lines (32 loc) · 1.03 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
const webpack = require('webpack');
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const BUILD_DIR = path.resolve(__dirname, './build');
const JSX_DIR = path.resolve(__dirname, './src/jsx');
const CSS_DIR = path.resolve(__dirname, './src/css');
const HTML_DIR = path.resolve(__dirname, './src/html');
const config = {
entry: JSX_DIR + '/index.jsx',
output: {
path: BUILD_DIR,
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.jsx$/,
include: JSX_DIR,
loader: 'babel-loader',
query: { babelrc: false, presets: ["es2015", "react"], "plugins": ["syntax-object-rest-spread", "transform-object-rest-spread"] }
},
]
},
plugins: [
new CopyWebpackPlugin([
{ from: HTML_DIR + '/index.html', to: BUILD_DIR },
{ from: CSS_DIR + '/index.css', to: BUILD_DIR }
])
],
devtool: "source-map"
};
module.exports = config;