-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
30 lines (29 loc) · 970 Bytes
/
webpack.config.js
File metadata and controls
30 lines (29 loc) · 970 Bytes
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
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
resolve: {
extensions: ['.js'],
alias: {
'@': path.join(__dirname, 'src')
}
},
plugins: [
new FriendlyErrorsPlugin(),
new webpack.HotModuleReplacementPlugin(),
new CopyWebpackPlugin([{
from: path.join(__dirname, 'src/texture'),
to: path.join(__dirname, 'dist/texture')
}])
],
module: {
rules: [{
test: /\.js$/,
loader: 'babel-loader',
include: [ path.join(__dirname, 'src'), path.join(__dirname, 'example')]
}]
},
devtool: process.env.NODE_ENV === 'production' ? 'cheap-module-eval-source-map' : 'cheap-module-source-map'
}