-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
55 lines (54 loc) · 1.71 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const path = require('path');
module.exports = {
entry: './src/index.js',
module: {
rules: [
{
test: [
/\.css$/i,
/\.s[ac]ss$/i,
],
use: [
{ loader: "style-loader" },
{ loader: "css-loader", options: { sourceMap: true } },
{ loader: "postcss-loader", options: { sourceMap: true } },
{ loader: "sass-loader", options: { api: "legacy", sourceMap: true } },
],
},
{
test: /\.(png|jpg|gif|svg|woff|woff2|eot|ttf|otf)$/i,
type: 'asset/resource',
},
{
loader: "webpack-modernizr-loader",
test: "/modernizr-config\.json$/",
type: 'javascript/auto',
},
{
// Expose jQuery for use outside Webpack build.
test: require.resolve('jquery'),
loader: "expose-loader",
options: {
exposes: ["$", "jquery", "jQuery"],
},
},
{
// Expose `js-cookie` for use outside Webpack build.
test: require.resolve('js-cookie'),
loader: "expose-loader",
options: {
exposes: ["Cookies"],
},
},
],
},
resolve: {
alias: {
modernizr$: path.resolve(__dirname, 'modernizr-config.json'),
},
},
output: {
path: path.resolve(__dirname, 'src', 'crate', 'theme', 'rtd', 'crate', 'static', 'bundle'),
filename: 'main.js',
},
};