Files
sphinx_rtd_theme/webpack.dev.js
T
Anthony Johnson 006921a145 A few additions for migration to webpack
* 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
2019-07-17 23:37:55 -06:00

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,
}),
]
});