2017-02-10 16:18:42 +01:00
|
|
|
|
const path = require('path');
|
2021-12-23 05:21:23 +01:00
|
|
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
|
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
2016-02-24 11:44:14 +01:00
|
|
|
|
|
2017-02-12 16:29:56 +01:00
|
|
|
|
// Generates a path to the output bundle to be loaded in the browser.
|
2021-12-23 05:21:23 +01:00
|
|
|
|
const getOutputPath = (app, folder, filename) => {
|
|
|
|
|
const exceptions = {
|
|
|
|
|
'documents': 'wagtaildocs',
|
|
|
|
|
'contrib/table_block': 'table_block',
|
|
|
|
|
'contrib/typed_table_block': 'typed_table_block',
|
|
|
|
|
'contrib/styleguide': 'wagtailstyleguide',
|
|
|
|
|
'contrib/modeladmin': 'wagtailmodeladmin',
|
2021-01-07 17:36:43 +01:00
|
|
|
|
};
|
|
|
|
|
|
2021-12-23 05:21:23 +01:00
|
|
|
|
const appLabel = exceptions[app] || `wagtail${app}`;
|
|
|
|
|
|
|
|
|
|
return path.join('wagtail', app, 'static', appLabel, folder, filename);
|
2021-01-05 20:24:40 +01:00
|
|
|
|
};
|
2016-02-24 11:44:14 +01:00
|
|
|
|
|
2018-01-17 22:23:17 +01:00
|
|
|
|
// Mapping from package name to exposed global variable.
|
|
|
|
|
const exposedDependencies = {
|
|
|
|
|
'focus-trap-react': 'FocusTrapReact',
|
|
|
|
|
'react': 'React',
|
|
|
|
|
'react-dom': 'ReactDOM',
|
|
|
|
|
'react-transition-group/CSSTransitionGroup': 'CSSTransitionGroup',
|
2018-01-17 23:07:39 +01:00
|
|
|
|
'draft-js': 'DraftJS',
|
|
|
|
|
};
|
2018-01-17 22:23:17 +01:00
|
|
|
|
|
2021-12-23 05:21:23 +01:00
|
|
|
|
module.exports = function exports(env, argv) {
|
|
|
|
|
const isProduction = argv.mode === 'production';
|
|
|
|
|
|
2021-01-05 15:24:30 +01:00
|
|
|
|
const entrypoints = {
|
2021-01-07 17:36:43 +01:00
|
|
|
|
'admin': [
|
2021-08-30 17:33:43 +02:00
|
|
|
|
'collapsible',
|
2020-12-04 12:13:45 +01:00
|
|
|
|
'comments',
|
2021-01-05 15:24:30 +01:00
|
|
|
|
'core',
|
|
|
|
|
'date-time-chooser',
|
|
|
|
|
'draftail',
|
2022-01-15 02:00:02 +01:00
|
|
|
|
'expanding-formset',
|
2021-01-05 15:24:30 +01:00
|
|
|
|
'filtered-select',
|
|
|
|
|
'lock-unlock-action',
|
|
|
|
|
'modal-workflow',
|
|
|
|
|
'page-chooser-modal',
|
|
|
|
|
'page-chooser',
|
|
|
|
|
'page-editor',
|
|
|
|
|
'privacy-switch',
|
2021-05-10 18:09:47 +02:00
|
|
|
|
'sidebar',
|
2021-01-05 15:24:30 +01:00
|
|
|
|
'task-chooser-modal',
|
|
|
|
|
'task-chooser',
|
2020-11-30 18:56:57 +01:00
|
|
|
|
'telepath/blocks',
|
|
|
|
|
'telepath/telepath',
|
|
|
|
|
'telepath/widgets',
|
2021-01-05 15:24:30 +01:00
|
|
|
|
'userbar',
|
|
|
|
|
'wagtailadmin',
|
|
|
|
|
'workflow-action',
|
|
|
|
|
'workflow-status',
|
2021-03-23 13:58:35 +01:00
|
|
|
|
'bulk-actions',
|
2021-08-27 14:57:34 +02:00
|
|
|
|
],
|
2022-04-12 17:11:08 +02:00
|
|
|
|
'images': [
|
|
|
|
|
'image-chooser',
|
|
|
|
|
'image-chooser-modal',
|
|
|
|
|
'image-chooser-telepath',
|
|
|
|
|
],
|
|
|
|
|
'documents': [
|
|
|
|
|
'document-chooser',
|
|
|
|
|
'document-chooser-modal',
|
|
|
|
|
'document-chooser-telepath',
|
|
|
|
|
],
|
2021-12-23 05:21:23 +01:00
|
|
|
|
'snippets': ['snippet-chooser', 'snippet-chooser-telepath'],
|
|
|
|
|
'contrib/table_block': ['table'],
|
|
|
|
|
'contrib/typed_table_block': ['typed_table_block'],
|
2021-01-05 15:24:30 +01:00
|
|
|
|
};
|
2020-12-04 10:47:38 +01:00
|
|
|
|
|
2020-12-04 12:34:26 +01:00
|
|
|
|
const entry = {};
|
2021-01-05 15:24:30 +01:00
|
|
|
|
for (const [appName, moduleNames] of Object.entries(entrypoints)) {
|
|
|
|
|
moduleNames.forEach((moduleName) => {
|
2020-12-27 18:53:41 +01:00
|
|
|
|
entry[moduleName] = {
|
2020-12-27 19:36:48 +01:00
|
|
|
|
import: [`./client/src/entrypoints/${appName}/${moduleName}.js`],
|
2021-12-23 05:21:23 +01:00
|
|
|
|
filename: getOutputPath(appName, 'js', moduleName) + '.js',
|
2020-12-27 18:53:41 +01:00
|
|
|
|
};
|
2021-01-05 15:24:30 +01:00
|
|
|
|
});
|
|
|
|
|
}
|
2020-12-04 10:47:38 +01:00
|
|
|
|
|
2021-12-23 05:21:23 +01:00
|
|
|
|
const sassEntry = {};
|
|
|
|
|
sassEntry[getOutputPath('admin', 'css', 'core')] = path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'admin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailadmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'core.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('admin', 'css', 'layouts/404')] = path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'admin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailadmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'layouts',
|
|
|
|
|
'404.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('admin', 'css', 'layouts/account')] = path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'admin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailadmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'layouts',
|
|
|
|
|
'account.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('admin', 'css', 'layouts/compare-revisions')] =
|
|
|
|
|
path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'admin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailadmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'layouts',
|
|
|
|
|
'compare-revisions.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('admin', 'css', 'layouts/home')] = path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'admin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailadmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'layouts',
|
|
|
|
|
'home.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('admin', 'css', 'layouts/login')] = path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'admin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailadmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'layouts',
|
|
|
|
|
'login.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('admin', 'css', 'layouts/page-editor')] =
|
|
|
|
|
path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'admin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailadmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'layouts',
|
|
|
|
|
'page-editor.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('admin', 'css', 'layouts/report')] = path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'admin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailadmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'layouts',
|
|
|
|
|
'report.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('admin', 'css', 'layouts/workflow-edit')] =
|
|
|
|
|
path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'admin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailadmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'layouts',
|
|
|
|
|
'workflow-edit.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('admin', 'css', 'layouts/workflow-progress')] =
|
|
|
|
|
path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'admin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailadmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'layouts',
|
|
|
|
|
'workflow-progress.scss',
|
|
|
|
|
);
|
|
|
|
|
// sassEntry[getOutputPath('admin', 'css', 'normalize')] = path.resolve('wagtail', 'admin', 'static_src', 'wagtailadmin', 'css', 'normalize.css');
|
|
|
|
|
sassEntry[getOutputPath('admin', 'css', 'panels/draftail')] = path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'admin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailadmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'panels',
|
|
|
|
|
'draftail.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('admin', 'css', 'panels/streamfield')] = path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'admin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailadmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'panels',
|
|
|
|
|
'streamfield.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('admin', 'css', 'userbar')] = path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'admin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailadmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'userbar.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('documents', 'css', 'add-multiple')] = path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'documents',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtaildocs',
|
|
|
|
|
'scss',
|
|
|
|
|
'add-multiple.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('images', 'css', 'add-multiple')] = path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'images',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailimages',
|
|
|
|
|
'scss',
|
|
|
|
|
'add-multiple.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('images', 'css', 'focal-point-chooser')] =
|
|
|
|
|
path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'images',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailimages',
|
|
|
|
|
'scss',
|
|
|
|
|
'focal-point-chooser.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('users', 'css', 'groups_edit')] = path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'users',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailusers',
|
|
|
|
|
'scss',
|
|
|
|
|
'groups_edit.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('contrib/styleguide', 'css', 'styleguide')] =
|
|
|
|
|
path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'contrib',
|
|
|
|
|
'styleguide',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailstyleguide',
|
|
|
|
|
'scss',
|
|
|
|
|
'styleguide.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('contrib/modeladmin', 'css', 'index')] = path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'contrib',
|
|
|
|
|
'modeladmin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailmodeladmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'index.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('contrib/modeladmin', 'css', 'breadcrumbs_page')] =
|
|
|
|
|
path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'contrib',
|
|
|
|
|
'modeladmin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailmodeladmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'breadcrumbs_page.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[getOutputPath('contrib/modeladmin', 'css', 'choose_parent_page')] =
|
|
|
|
|
path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'contrib',
|
|
|
|
|
'modeladmin',
|
|
|
|
|
'static_src',
|
|
|
|
|
'wagtailmodeladmin',
|
|
|
|
|
'scss',
|
|
|
|
|
'choose_parent_page.scss',
|
|
|
|
|
);
|
|
|
|
|
sassEntry[
|
|
|
|
|
getOutputPath('contrib/typed_table_block', 'css', 'typed_table_block')
|
|
|
|
|
] = path.resolve(
|
|
|
|
|
'wagtail',
|
|
|
|
|
'contrib',
|
|
|
|
|
'typed_table_block',
|
|
|
|
|
'static_src',
|
|
|
|
|
'typed_table_block',
|
|
|
|
|
'scss',
|
|
|
|
|
'typed_table_block.scss',
|
|
|
|
|
);
|
|
|
|
|
|
2016-02-24 11:44:14 +01:00
|
|
|
|
return {
|
2021-12-23 05:21:23 +01:00
|
|
|
|
entry: {
|
|
|
|
|
...entry,
|
|
|
|
|
...sassEntry,
|
|
|
|
|
},
|
2016-02-24 11:44:14 +01:00
|
|
|
|
output: {
|
2017-06-07 11:39:24 +02:00
|
|
|
|
path: path.resolve('.'),
|
2021-12-23 05:21:23 +01:00
|
|
|
|
publicPath: '/static/',
|
2016-02-24 11:44:14 +01:00
|
|
|
|
},
|
2017-02-12 16:29:56 +01:00
|
|
|
|
resolve: {
|
2020-10-21 01:51:09 +02:00
|
|
|
|
extensions: ['.ts', '.tsx', '.js'],
|
2020-12-27 18:53:41 +01:00
|
|
|
|
|
|
|
|
|
// Some libraries import Node modules but don't use them in the browser.
|
|
|
|
|
// Tell Webpack to provide empty mocks for them so importing them works.
|
|
|
|
|
fallback: {
|
|
|
|
|
fs: false,
|
|
|
|
|
net: false,
|
|
|
|
|
tls: false,
|
|
|
|
|
},
|
2017-02-12 16:29:56 +01:00
|
|
|
|
},
|
2020-12-21 15:58:12 +01:00
|
|
|
|
externals: {
|
|
|
|
|
jquery: 'jQuery',
|
|
|
|
|
},
|
2021-12-23 05:21:23 +01:00
|
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
|
new MiniCssExtractPlugin({
|
|
|
|
|
filename: '[name].css',
|
|
|
|
|
}),
|
|
|
|
|
new CopyPlugin({
|
|
|
|
|
patterns: [
|
|
|
|
|
{
|
|
|
|
|
from: 'wagtail/admin/static_src/',
|
|
|
|
|
to: 'wagtail/admin/static/',
|
|
|
|
|
globOptions: { ignore: ['**/{app,scss}/**', '*.{css,txt}'] },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
from: 'wagtail/documents/static_src/',
|
|
|
|
|
to: 'wagtail/documents/static/',
|
|
|
|
|
globOptions: { ignore: ['**/{app,scss}/**', '*.{css,txt}'] },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
from: 'wagtail/embeds/static_src/',
|
|
|
|
|
to: 'wagtail/embeds/static/',
|
|
|
|
|
globOptions: { ignore: ['**/{app,scss}/**', '*.{css,txt}'] },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
from: 'wagtail/images/static_src/',
|
|
|
|
|
to: 'wagtail/images/static/',
|
|
|
|
|
globOptions: { ignore: ['**/{app,scss}/**', '*.{css,txt}'] },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
from: 'wagtail/search/static_src/',
|
|
|
|
|
to: 'wagtail/search/static/',
|
|
|
|
|
globOptions: { ignore: ['**/{app,scss}/**', '*.{css,txt}'] },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
from: 'wagtail/snippets/static_src/',
|
|
|
|
|
to: 'wagtail/snippets/static/',
|
|
|
|
|
globOptions: { ignore: ['**/{app,scss}/**', '*.{css,txt}'] },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
from: 'wagtail/users/static_src/',
|
|
|
|
|
to: 'wagtail/users/static/',
|
|
|
|
|
globOptions: { ignore: ['**/{app,scss}/**', '*.{css,txt}'] },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
from: 'wagtail/contrib/settings/static_src/',
|
|
|
|
|
to: 'wagtail/contrib/settings/static/',
|
|
|
|
|
globOptions: { ignore: ['**/{app,scss}/**', '*.{css,txt}'] },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
from: 'wagtail/contrib/modeladmin/static_src/',
|
|
|
|
|
to: 'wagtail/contrib/modeladmin/static/',
|
|
|
|
|
globOptions: { ignore: ['**/{app,scss}/**', '*.{css,txt}'] },
|
2022-02-04 12:57:55 +01:00
|
|
|
|
},
|
2021-12-23 05:21:23 +01:00
|
|
|
|
],
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
|
2016-02-24 11:44:14 +01:00
|
|
|
|
module: {
|
2017-06-07 11:39:24 +02:00
|
|
|
|
rules: [
|
2016-02-24 11:44:14 +01:00
|
|
|
|
{
|
2020-10-21 01:51:09 +02:00
|
|
|
|
test: /\.(js|ts)x?$/,
|
2020-10-21 10:42:14 +02:00
|
|
|
|
loader: 'ts-loader',
|
2017-05-28 20:49:05 +02:00
|
|
|
|
exclude: /node_modules/,
|
2016-02-24 11:44:14 +01:00
|
|
|
|
},
|
2021-12-23 05:21:23 +01:00
|
|
|
|
{
|
|
|
|
|
// Legacy support for font icon loading, to be removed.
|
|
|
|
|
test: /\.(woff)$/i,
|
|
|
|
|
generator: {
|
|
|
|
|
emit: false,
|
|
|
|
|
filename: 'wagtailadmin/fonts/[name][ext]',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
test: /\.(svg)$/i,
|
|
|
|
|
type: 'asset/inline',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
test: /\.(scss|css)$/,
|
|
|
|
|
use: [
|
|
|
|
|
MiniCssExtractPlugin.loader,
|
|
|
|
|
'css-loader',
|
|
|
|
|
{
|
|
|
|
|
loader: 'postcss-loader',
|
|
|
|
|
options: {
|
|
|
|
|
postcssOptions: {
|
2022-02-27 17:08:38 +01:00
|
|
|
|
plugins: ['tailwindcss', 'autoprefixer', 'cssnano'],
|
2021-12-23 05:21:23 +01:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
'sass-loader',
|
|
|
|
|
],
|
|
|
|
|
},
|
2018-01-17 22:23:17 +01:00
|
|
|
|
].concat(
|
|
|
|
|
Object.keys(exposedDependencies).map((name) => {
|
2018-01-18 18:06:04 +01:00
|
|
|
|
const globalName = exposedDependencies[name];
|
|
|
|
|
|
2018-01-17 22:23:17 +01:00
|
|
|
|
// Create expose-loader configs for each Wagtail dependency.
|
|
|
|
|
return {
|
|
|
|
|
test: require.resolve(name),
|
2018-01-18 18:06:04 +01:00
|
|
|
|
use: [
|
|
|
|
|
{
|
2018-01-17 22:23:17 +01:00
|
|
|
|
loader: 'expose-loader',
|
2020-12-27 18:53:41 +01:00
|
|
|
|
options: {
|
2020-12-04 12:13:45 +01:00
|
|
|
|
exposes: {
|
|
|
|
|
globalName,
|
|
|
|
|
override: true,
|
2022-02-04 12:57:55 +01:00
|
|
|
|
},
|
2020-12-04 12:13:45 +01:00
|
|
|
|
},
|
2020-12-27 18:53:41 +01:00
|
|
|
|
},
|
2018-01-18 18:06:04 +01:00
|
|
|
|
],
|
|
|
|
|
};
|
2018-01-17 22:23:17 +01:00
|
|
|
|
}),
|
2022-02-04 12:57:55 +01:00
|
|
|
|
),
|
2017-02-12 16:29:56 +01:00
|
|
|
|
},
|
2018-02-17 13:54:06 +01:00
|
|
|
|
|
2020-05-29 01:39:20 +02:00
|
|
|
|
optimization: {
|
|
|
|
|
splitChunks: {
|
|
|
|
|
cacheGroups: {
|
|
|
|
|
vendor: {
|
2021-12-23 05:21:23 +01:00
|
|
|
|
name: getOutputPath('admin', 'js', 'vendor'),
|
2020-05-29 01:39:20 +02:00
|
|
|
|
chunks: 'initial',
|
|
|
|
|
minChunks: 2,
|
|
|
|
|
reuseExistingChunk: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
2018-02-17 13:54:06 +01:00
|
|
|
|
// See https://webpack.js.org/configuration/devtool/.
|
2021-12-23 05:21:23 +01:00
|
|
|
|
devtool: isProduction ? false : 'eval-cheap-module-source-map',
|
2018-02-17 13:54:06 +01:00
|
|
|
|
|
2020-05-28 18:43:06 +02:00
|
|
|
|
// For development mode only.
|
|
|
|
|
watchOptions: {
|
|
|
|
|
poll: 1000,
|
|
|
|
|
aggregateTimeout: 300,
|
|
|
|
|
},
|
|
|
|
|
|
2020-10-21 11:00:45 +02:00
|
|
|
|
// Disable performance hints – currently there are much more valuable
|
|
|
|
|
// optimizations for us to do outside of Webpack
|
|
|
|
|
performance: {
|
|
|
|
|
hints: false,
|
|
|
|
|
},
|
|
|
|
|
|
2017-02-12 16:29:56 +01:00
|
|
|
|
stats: {
|
|
|
|
|
// Add chunk information (setting this to `false` allows for a less verbose output)
|
|
|
|
|
chunks: false,
|
|
|
|
|
// Add the hash of the compilation
|
|
|
|
|
hash: false,
|
|
|
|
|
// `webpack --colors` equivalent
|
|
|
|
|
colors: true,
|
|
|
|
|
// Add information about the reasons why modules are included
|
|
|
|
|
reasons: false,
|
|
|
|
|
// Add webpack version information
|
|
|
|
|
version: false,
|
2017-06-07 15:21:12 +02:00
|
|
|
|
},
|
2016-02-24 11:44:14 +01:00
|
|
|
|
};
|
|
|
|
|
};
|