-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.docs.js
More file actions
43 lines (37 loc) · 1003 Bytes
/
webpack.config.docs.js
File metadata and controls
43 lines (37 loc) · 1003 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
43
const path = require('path');
const {CleanWebpackPlugin} = require('clean-webpack-plugin');
const CONTENT_BASE = path.join(__dirname, './');
const {version} = require('./package.json');
module.exports = function () {
return {
mode: 'production',
target: 'web',
devtool: 'inline-cheap-source-map',
entry: {
docs: path.join(CONTENT_BASE, 'docs', 'docs.js')
},
output: {
path: path.resolve(__dirname, 'dist/'),
filename: `docs-${version}.js`
},
module: {
rules: [
{
test: /\.js$/,
use: ['babel-loader'],
include: CONTENT_BASE,
exclude: [path.resolve(__dirname, 'node_modules')]
},
{
test: /\.(ttf|otf|eot|woff(2)?)(\?[a-z0-9]+)?$/,
loader: 'file-loader?name=fonts/[hash].[ext]' // use [hash] to hide the font real name
},
{
test: /\.(png|jpe?g|svg)$/,
loader: 'url-loader?name=images/[hash].[ext]&limit=8192' // use [hash] to hide the font real name
}
]
},
plugins: [new CleanWebpackPlugin()]
};
};