-
Notifications
You must be signed in to change notification settings - Fork 21
/
webpack.docs.config.js
53 lines (51 loc) · 1.2 KB
/
webpack.docs.config.js
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
44
45
46
47
48
49
50
51
52
53
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const srcDir = path.resolve(__dirname, 'src'),
docsDir = path.resolve(__dirname, 'docs');
module.exports = {
mode: 'production',
entry: { fibonacci: './src/fibonacci.js' },
plugins: [
new MiniCssExtractPlugin(),
new CopyPlugin({
patterns: [
{ from: '*.html', context: srcDir },
{ from: 'blog_resources', to: 'blog_resources/', context: srcDir },
{ from: 'assets', to: 'assets/', context: srcDir }
],
})
],
output: {
path: docsDir
},
module: {
rules: [
{
test: /\.s[ac]ss$/i,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: { import: false }
},
'sass-loader',
],
},
{
test: /\.js[x]?$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader'
}
}
]
},
resolve: {
modules: [path.resolve(__dirname), 'node_modules'],
extensions: ['.js', '.json', '.css', '.scss', '.sass']
},
optimization: {
minimize: true
}
};