mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2026-10-12 09:24:51 -05:00
* Fix issues on paths in build and dev files * Skip yarn to reduce tooling requirements * Minify CSS assets in production * Reduce imports on fonts, hardcode font pieces more. There are problems with the font family names. Roboto mixin brings in everything as `Roboto-Slab-Bold`, which won't match local font name of 'Roboto Slab' * Fix the development instance more: * Add file watching on reST files * Execute build docs command after webpack build Things I'm still not sure about: - [ ] The actual JS output, I haven't vetted this yet - [ ] If woff2 and woff are enough for fonts. The NPM packages are missing other formats
34 lines
843 B
JavaScript
34 lines
843 B
JavaScript
const path = require('path');
|
|
const merge = require('webpack-merge');
|
|
const exec = require('child_process').exec;
|
|
const FilewatcherPlugin = require('filewatcher-webpack-plugin');
|
|
const WatchPlugin = require('webpack-watch-files-plugin').default;
|
|
const ShellPlugin = require('webpack-shell-plugin');
|
|
const common = require('./webpack.common.js');
|
|
|
|
module.exports = merge(common, {
|
|
mode: 'development',
|
|
watch: true,
|
|
devServer: {
|
|
contentBase: path.join(__dirname, 'docs/build/html'),
|
|
watchContentBase: true,
|
|
compress: false,
|
|
port: 7070,
|
|
hot: false,
|
|
liveReload: true,
|
|
publicPath: '/_static/'
|
|
},
|
|
plugins: [
|
|
new WatchPlugin({
|
|
files: [
|
|
'./docs/**/*.rst',
|
|
'./docs/**/*.py',
|
|
]
|
|
}),
|
|
new ShellPlugin({
|
|
onBuildEnd: ['make -C docs html'],
|
|
dev: false,
|
|
}),
|
|
]
|
|
});
|