Debian Codegraph @

webpack.common.js

raw
1 const path = require("path");
2 const MiniCssExtractPlugin = require("mini-css-extract-plugin");
3
4 module.exports = {
5 entry: {
6 theme: ["./src/theme.js", "./src/sass/theme.sass"],
7 badge_only: "./src/sass/badge_only.sass"
8 },
9 output: {
10 filename: "js/[name].js?[hash]",
11 path: path.resolve(__dirname, "sphinx_rtd_theme/static")
12 },
13 externals: {
14 jquery: "jQuery"
15 },
16 module: {
17 rules: [
18 {
19 test: require.resolve("./src/theme.js"),
20 use: "imports-loader?this=>window"
21 },
22 {
23 test: /\.sass$/,
24 use: [
25 {
26 loader: MiniCssExtractPlugin.loader,
27 options: {
28 hmr: false,
29 reloadAll: true
30 }
31 },
32 {
33 loader: "css-loader"
34 },
35 {
36 loader: "sass-loader?indentedSyntax",
37 options: {
38 includePaths: [
39 "node_modules/bourbon/app/assets/stylesheets",
40 "node_modules/bourbon-neat/app/assets/stylesheets",
41 "node_modules/font-awesome/scss",
42 "node_modules/wyrm/sass"
43 ]
44 }
45 }
46 ]
47 },
48 {
49 test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
50 use: [
51 {
52 loader: "file-loader",
53 options: {
54 name: "[name].[ext]?[hash]",
55 outputPath: "css/fonts/",
56 publicPath: "fonts/"
57 }
58 }
59 ]
60 }
61 ]
62 },
63 plugins: [
64 new MiniCssExtractPlugin({
65 filename: "css/[name].css?[hash]",
66 chunkFilename: "css/[name].css?[hash]"
67 }),
68 ]
69 };