Skip to content

Commit 8849452

Browse files
committed
feat: speed up local dev builds of the new es-module work
1 parent 1e0a8d0 commit 8849452

File tree

4 files changed

+44
-13
lines changed

4 files changed

+44
-13
lines changed

packages/build-tools/cli.js

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ const configStore = require('@bolt/build-utils/config-store');
88
const log = require('@bolt/build-utils/log');
99
const { readYamlFileSync } = require('@bolt/build-utils/yaml');
1010
const { getPort } = require('@bolt/build-utils/get-port');
11+
const boxen = require('boxen');
12+
const chalk = require('chalk');
13+
1114
const configSchema = readYamlFileSync(
1215
path.join(__dirname, './utils/config.schema.yml'),
1316
);
@@ -143,15 +146,38 @@ if (program.configFile) {
143146

144147
const config = await configStore.getConfig();
145148

146-
log.dim(`Verbosity: ${config.verbosity}`);
147-
log.dim(`Prod: ${config.prod}`);
148-
log.dim(`i18n: ${config.i18n}`);
149-
log.dim(
150-
`enableSSR: ${config.enableSSR} ${
151-
originalConfig.enableSSR ? '(manually set)' : '(auto set)'
152-
}`,
149+
const defaultConfigLog = chalk.white(`
150+
Logging Verbosity: ${config.verbosity}
151+
Environment: ${config.prod ? 'Production' : 'Development'}
152+
Multi-lang: ${config.i18n}
153+
ES Modules Enabled: ${config.esModules}
154+
`);
155+
156+
console.log(
157+
boxen(defaultConfigLog, {
158+
padding: {
159+
top: 0,
160+
bottom: 0,
161+
left: 3,
162+
right: 3,
163+
},
164+
margin: {
165+
top: 1,
166+
bottom: 0,
167+
left: 1,
168+
right: 1,
169+
},
170+
borderStyle: 'double',
171+
}),
153172
);
154-
log.dim(`Rendering Mode: ${config.mode}`);
173+
174+
// @todo: re-enable once JS-based SSR gets re-enabled and ships
175+
// log.dim(
176+
// `enableSSR: ${config.enableSSR} ${
177+
// originalConfig.enableSSR ? '(manually set)' : '(auto set)'
178+
// }`,
179+
// );
180+
// log.dim(`Rendering Mode: ${config.mode}`);
155181
if (config.verbosity > 2) {
156182
log.dim(`Opening browser: ${config.openServerAtStart}`);
157183
log.dim(`Quick mode: ${config.quick}`);

packages/build-tools/create-webpack-config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,11 @@ async function createWebpackConfig(buildConfig) {
562562
// if esModules support is enabled in the .boltrc config, serve up just the modern bundle for local dev + legacy + modern bundles in prod.
563563
// Otherwise, continue serving the legacy bundle to everyone.
564564
if (config.esModules) {
565-
return [legacyWebpackConfig, modernWebpackConfig];
565+
if (config.prod) {
566+
return [legacyWebpackConfig, modernWebpackConfig];
567+
} else {
568+
return [modernWebpackConfig];
569+
}
566570
} else {
567571
return [legacyWebpackConfig];
568572
}

packages/build-tools/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
"bin": {
1616
"bolt": "index.js"
1717
},
18-
"browserslist": [
19-
"extends @bolt/browserslist-config"
20-
],
2118
"scripts": {
2219
"test": "FORCE_COLOR=1 npx lerna exec --scope @bolt/build-tools--test* --concurrency 1 -- yarn run test"
2320
},
21+
"browserslist": [
22+
"extends @bolt/browserslist-config"
23+
],
2424
"dependencies": {
2525
"@babel/core": "^7.4.5",
2626
"@bolt/api": "^2.13.0",
@@ -38,6 +38,7 @@
3838
"autoprefixer": "^9.5.1",
3939
"babel-loader": "^8.0.6",
4040
"better-opn": "^0.1.4",
41+
"boxen": "^4.2.0",
4142
"browser-sync": "^2.26.5",
4243
"cache-loader": "^4.1.0",
4344
"camelcase": "^5.3.1",

packages/core-v2.x/styles/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
BOLT CSS CORE
33
\* ------------------------------------ */
44

5-
@warn "You are using the old version of Bolt Core which will stop working in Bolt v3.0.";
5+
@warn "You are using the old v2.x version of Bolt's Core Sass styles which will stop working when Bolt v3.0 is released.";
66

77
@import 'sassy-lists';
88
@import 'sass-mq/_mq';

0 commit comments

Comments
 (0)