-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathwebpack.config.js
More file actions
42 lines (39 loc) · 973 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
42 lines (39 loc) · 973 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
31
32
33
34
35
36
37
38
39
40
41
42
const path = require('path');
module.exports = {
entry: './src/index.js',
mode: 'development',
// mode: 'production',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'WebpackShowcase.min.js',
library: {
name: 'module.exports',
type: 'assign',
export: 'default'
}
},
module: {
rules: []
}
}
// Add support for JS and JSX
module.exports.module.rules.push({
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
})
// Add support for resource files
module.exports.module.rules.push({
test: /\.(png|svg|jpg|gif|woff|woff2|eot|ttf|otf|ico|mp3|mp4|wav|hdr|glb)$/,
use: [
{
loader: 'url-loader',
options: {
esModule: false, // Required so that calling `require()` on a file actually works.
limit: 10000000
},
},
],
})