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