forked from balena-io/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
33 lines (32 loc) · 898 Bytes
/
webpack.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
const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const webpack = require('webpack')
const languages = require('./static/scripts/langs')
module.exports = {
entry: path.resolve(__dirname, 'static/scripts/main.js'),
output: {
path: path.resolve(__dirname, 'static/dist'),
filename: 'main.js',
publicPath: '/dist/'
},
module: {
rules: [
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
{ test: /\.(woff2?|ttf|eot|svg|png|gif|jpg|jpeg)$/, use: 'url-loader?limit=10000' },
]
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'
}),
new webpack.ContextReplacementPlugin(
/highlight\.js\/lib\/languages$/,
new RegExp(`^./(${languages.join('|')})$`)
),
new MiniCssExtractPlugin({filename: 'style.css'})
]
};