forked from balena-io/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
35 lines (34 loc) · 910 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
34
35
const path = require('path')
const ExtractTextPlugin = require("extract-text-webpack-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: '/docs/dist/'
},
module: {
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
use: '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 ExtractTextPlugin('style.css')
]
};