fix: build

This commit is contained in:
cha0s 2022-03-17 17:42:04 -05:00
parent 2546e2502a
commit a7150c1d92
4 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,3 @@
const banner = require('@neutrinojs/banner');
const clean = require('@neutrinojs/clean'); const clean = require('@neutrinojs/clean');
const compileLoader = require('@neutrinojs/compile-loader'); const compileLoader = require('@neutrinojs/compile-loader');
const babelMerge = require('babel-merge'); const babelMerge = require('babel-merge');
@ -35,7 +34,6 @@ module.exports = ({
), ),
}), }),
); );
neutrino.use(banner());
neutrino.use(clean({cleanStaleWebpackAssets: false})); neutrino.use(clean({cleanStaleWebpackAssets: false}));
/* eslint-disable indent */ /* eslint-disable indent */
config config

View File

@ -10,6 +10,7 @@ export default {
* Webpack stats configuration when building fleck target. * Webpack stats configuration when building fleck target.
*/ */
stats: { stats: {
children: false,
chunks: false, chunks: false,
colors: true, colors: true,
modules: false, modules: false,

View File

@ -44,6 +44,7 @@ module.exports = (async () => {
title: 'Testbed', title: 'Testbed',
}; };
options.output = join(originalOutput, flecks.get('@flecks/http/server.output')); options.output = join(originalOutput, flecks.get('@flecks/http/server.output'));
// Load HTML.
neutrino.use(htmlLoader()); neutrino.use(htmlLoader());
Object.entries(options.mains).forEach(([name, mainsConfig]) => { Object.entries(options.mains).forEach(([name, mainsConfig]) => {
const {entry, ...htmlTemplateConfig} = 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 config.module
.rule('maps') .rule('maps')
.test(/\.js$/) .test(/\.js$/)
@ -121,7 +124,7 @@ module.exports = (async () => {
.publicPath('/') .publicPath('/')
.filename(isProduction ? 'assets/[name].[contenthash:8].js' : 'assets/[name].js'); .filename(isProduction ? 'assets/[name].[contenthash:8].js' : 'assets/[name].js');
config config
.devtool('source-map') .devtool(isProduction ? 'source-map' : 'cheap-module-source-map')
.target('web'); .target('web');
config.node config.node
.set('Buffer', true) .set('Buffer', true)
@ -137,10 +140,7 @@ module.exports = (async () => {
'.json', '.json',
]); ]);
config.resolve.modules config.resolve.modules
.merge([ .merge([join(FLECKS_CORE_ROOT, 'node_modules')]);
join(FLECKS_CORE_ROOT, 'node_modules'),
'node_modules',
]);
// Reporting. // Reporting.
config.stats(flecks.get('@flecks/http/server.stats')); config.stats(flecks.get('@flecks/http/server.stats'));
// Inline the main entrypoint (nice for FCP). // Inline the main entrypoint (nice for FCP).

View File

@ -150,6 +150,7 @@ export default {
* Webpack stats configuration when building HTTP target. * Webpack stats configuration when building HTTP target.
*/ */
stats: { stats: {
children: false,
chunks: false, chunks: false,
colors: true, colors: true,
modules: false, modules: false,