fix: build
This commit is contained in:
parent
2546e2502a
commit
a7150c1d92
|
@ -1,4 +1,3 @@
|
|||
const banner = require('@neutrinojs/banner');
|
||||
const clean = require('@neutrinojs/clean');
|
||||
const compileLoader = require('@neutrinojs/compile-loader');
|
||||
const babelMerge = require('babel-merge');
|
||||
|
@ -35,7 +34,6 @@ module.exports = ({
|
|||
),
|
||||
}),
|
||||
);
|
||||
neutrino.use(banner());
|
||||
neutrino.use(clean({cleanStaleWebpackAssets: false}));
|
||||
/* eslint-disable indent */
|
||||
config
|
||||
|
|
|
@ -10,6 +10,7 @@ export default {
|
|||
* Webpack stats configuration when building fleck target.
|
||||
*/
|
||||
stats: {
|
||||
children: false,
|
||||
chunks: false,
|
||||
colors: true,
|
||||
modules: false,
|
||||
|
|
|
@ -44,6 +44,7 @@ module.exports = (async () => {
|
|||
title: 'Testbed',
|
||||
};
|
||||
options.output = join(originalOutput, flecks.get('@flecks/http/server.output'));
|
||||
// Load HTML.
|
||||
neutrino.use(htmlLoader());
|
||||
Object.entries(options.mains).forEach(([name, mainsConfig]) => {
|
||||
const {entry, ...htmlTemplateConfig} = mainsConfig;
|
||||
|
@ -90,7 +91,9 @@ module.exports = (async () => {
|
|||
}),
|
||||
);
|
||||
});
|
||||
// Fold in existing source maps.
|
||||
// Install source-map-support and fold in existing source maps.
|
||||
config.entry('index')
|
||||
.add('source-map-support');
|
||||
config.module
|
||||
.rule('maps')
|
||||
.test(/\.js$/)
|
||||
|
@ -121,7 +124,7 @@ module.exports = (async () => {
|
|||
.publicPath('/')
|
||||
.filename(isProduction ? 'assets/[name].[contenthash:8].js' : 'assets/[name].js');
|
||||
config
|
||||
.devtool('source-map')
|
||||
.devtool(isProduction ? 'source-map' : 'cheap-module-source-map')
|
||||
.target('web');
|
||||
config.node
|
||||
.set('Buffer', true)
|
||||
|
@ -137,10 +140,7 @@ module.exports = (async () => {
|
|||
'.json',
|
||||
]);
|
||||
config.resolve.modules
|
||||
.merge([
|
||||
join(FLECKS_CORE_ROOT, 'node_modules'),
|
||||
'node_modules',
|
||||
]);
|
||||
.merge([join(FLECKS_CORE_ROOT, 'node_modules')]);
|
||||
// Reporting.
|
||||
config.stats(flecks.get('@flecks/http/server.stats'));
|
||||
// Inline the main entrypoint (nice for FCP).
|
||||
|
|
|
@ -150,6 +150,7 @@ export default {
|
|||
* Webpack stats configuration when building HTTP target.
|
||||
*/
|
||||
stats: {
|
||||
children: false,
|
||||
chunks: false,
|
||||
colors: true,
|
||||
modules: false,
|
||||
|
|
Loading…
Reference in New Issue
Block a user