2019-07-26 16:35:35 -05:00
|
|
|
const path = require("path");
|
|
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
2019-07-02 05:17:20 -05:00
|
|
|
|
|
|
|
module.exports = {
|
2019-07-26 16:35:35 -05:00
|
|
|
entry: "./src/index.js",
|
2019-07-02 05:17:20 -05:00
|
|
|
output: {
|
2019-07-26 16:35:35 -05:00
|
|
|
filename: "js/theme.js",
|
|
|
|
path: path.resolve(__dirname, "sphinx_rtd_theme/static")
|
2019-07-02 05:17:20 -05:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
2019-07-26 16:35:35 -05:00
|
|
|
test: require.resolve("./src/theme.js"),
|
|
|
|
use: "imports-loader?this=>window"
|
2019-07-02 05:17:20 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.sass$/,
|
2019-07-26 16:35:35 -05:00
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: MiniCssExtractPlugin.loader
|
|
|
|
},
|
|
|
|
{
|
|
|
|
loader: "css-loader"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
loader: "sass-loader?indentedSyntax",
|
|
|
|
options: {
|
|
|
|
includePaths: [
|
|
|
|
"node_modules/bourbon/app/assets/stylesheets",
|
|
|
|
"node_modules/bourbon-neat/app/assets/stylesheets",
|
|
|
|
"node_modules/font-awesome/scss",
|
|
|
|
"node_modules/wyrm/sass"
|
|
|
|
]
|
|
|
|
}
|
2019-07-02 05:17:20 -05:00
|
|
|
}
|
2019-07-26 16:35:35 -05:00
|
|
|
]
|
2019-07-02 05:17:20 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
|
2019-07-26 16:35:35 -05:00
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: "file-loader",
|
|
|
|
options: {
|
|
|
|
name: "[name].[ext]?[hash]",
|
|
|
|
outputPath: "fonts/",
|
|
|
|
publicPath: "../fonts/"
|
|
|
|
}
|
2019-07-02 05:17:20 -05:00
|
|
|
}
|
2019-07-26 16:35:35 -05:00
|
|
|
]
|
2019-07-02 05:17:20 -05:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new MiniCssExtractPlugin({
|
|
|
|
// Options similar to the same options in webpackOptions.output
|
|
|
|
// both options are optional
|
2019-07-26 16:35:35 -05:00
|
|
|
filename: "css/theme.css"
|
2019-07-02 05:17:20 -05:00
|
|
|
})
|
2019-07-26 16:35:35 -05:00
|
|
|
]
|
2019-07-18 00:37:55 -05:00
|
|
|
};
|