feat: delegate build scripts to edx/frontend-build (#257)

This commit is contained in:
Adam Butterworth
2019-09-25 11:54:49 -04:00
committed by GitHub
parent 5c38302eec
commit be67c13914
17 changed files with 3839 additions and 14877 deletions

21
webpack.prod.config.js Normal file
View File

@@ -0,0 +1,21 @@
const glob = require('glob');
const PurgecssPlugin = require('purgecss-webpack-plugin');
const { createConfig } = require('@edx/frontend-build');
module.exports = createConfig('webpack-prod', {
plugins: [
// Scan files for class names and ids and remove unused css
new PurgecssPlugin({
paths: [].concat(
// Scan files in this app
glob.sync('src/**/*', { nodir: true }),
// Scan files in any edx frontend-component
glob.sync('node_modules/@edx/frontend-component*/**/*', { nodir: true }),
// Scan files in paragon
glob.sync('node_modules/@edx/paragon/**/*', { nodir: true }),
),
// Protect react-css-transition class names
whitelistPatterns: [/-enter/, /-appear/, /-exit/],
}),
],
});