mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2025-02-25 18:55:21 -06:00
54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
|
const path = require('path');
|
||
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||
|
|
||
|
module.exports = {
|
||
|
entry: './src/index.js',
|
||
|
output: {
|
||
|
filename: 'js/theme.js',
|
||
|
path: path.resolve(__dirname, 'sphinx_rtd_theme/static')
|
||
|
},
|
||
|
module: {
|
||
|
rules: [
|
||
|
{
|
||
|
test: require.resolve('./src/theme.js'),
|
||
|
use: 'imports-loader?this=>window'
|
||
|
},
|
||
|
{
|
||
|
test: /\.sass$/,
|
||
|
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'
|
||
|
]
|
||
|
}
|
||
|
}]
|
||
|
},
|
||
|
{
|
||
|
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
|
||
|
use: [{
|
||
|
loader: 'file-loader',
|
||
|
options: {
|
||
|
name: '[name].[ext]',
|
||
|
outputPath: 'fonts/',
|
||
|
publicPath: '/_static/fonts',
|
||
|
}
|
||
|
}]
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
plugins: [
|
||
|
new MiniCssExtractPlugin({
|
||
|
// Options similar to the same options in webpackOptions.output
|
||
|
// both options are optional
|
||
|
filename: 'css/theme.css'
|
||
|
})
|
||
|
]
|
||
|
};
|