Files
shields/next.config.js
Paul Melnikow ac7c418222 Extract examples from new-style services (#1582)
Instead of centralizing examples, specify them from within a service.

* Avoid duplication in service loading + refactor
* Avoid duplication in URLs, rename uri -> url in BaseService
2018-03-30 03:07:44 -05:00

31 lines
834 B
JavaScript

const envFlag = require('node-env-flag');
const webpack = require('webpack');
const shouldAnalyze = envFlag(process.env.ANALYZE);
module.exports = {
webpack: config => {
config.plugins.push(new webpack.EnvironmentPlugin({ BASE_URL: null, LONG_CACHE: null }));
if (shouldAnalyze) {
// We don't include webpack-bundle-analyzer in devDependencies, so load
// lazily.
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
config.plugins.push(new BundleAnalyzerPlugin({
analyzerMode: 'server',
analyzerPort: 8888,
openAnalyzer: true,
}));
}
config.module.loaders = (config.module.loaders || []).concat({
test: /\.json$/,
loader: 'json-loader',
});
return config;
},
exportPathMap: () => ({
'/': { page: '/' },
}),
};