From 21fe06a2f70ccb5e429358f5edfd6c8d9ff9155a Mon Sep 17 00:00:00 2001 From: Alexis Georges Date: Tue, 14 Jan 2020 14:47:21 +0100 Subject: [PATCH] fix(stark-build): fix prettier - Module not found: Error: Can't resolve '@microsoft/typescript-etw' ISSUES CLOSED: #1483 --- .../config/webpack-partial.common.js | 49 ++++++++++--------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/packages/stark-build/config/webpack-partial.common.js b/packages/stark-build/config/webpack-partial.common.js index 190c22fa4b..a8dacef4ca 100644 --- a/packages/stark-build/config/webpack-partial.common.js +++ b/packages/stark-build/config/webpack-partial.common.js @@ -72,6 +72,9 @@ module.exports = metadata => { * See: https://webpack.js.org/configuration/module */ module: { + // FIXME Remove the following line once Prettier 2.0.0 is released. See: https://github.com/NationalBankBelgium/stark/issues/1483 + noParse: /prettier\/parser-typescript/, + rules: [ /** * TSLint loader support for *.ts files @@ -156,10 +159,10 @@ module.exports = metadata => { // xhtml: true, // TODO: why XHTML? minify: isProd ? { - caseSensitive: true, - collapseWhitespace: true, - keepClosingSlash: true - } + caseSensitive: true, + collapseWhitespace: true, + keepClosingSlash: true + } : false }), @@ -229,10 +232,10 @@ module.exports = metadata => { */ ...(fs.existsSync(helpers.root("config/index-head-config.js")) ? [ - new HtmlElementsWebpackPlugin({ - headTags: require(helpers.root("config/index-head-config")) - }) - ] + new HtmlElementsWebpackPlugin({ + headTags: require(helpers.root("config/index-head-config")) + }) + ] : []), /** @@ -252,14 +255,14 @@ module.exports = metadata => { */ ...(MONITOR ? [ - new WebpackMonitor({ - capture: true, // -> default 'true' - target: helpers.root("reports/webpack-monitor/stats.json"), // default -> '../monitor/stats.json' - launch: true, // -> default 'false' - port: 3030, // default 8081 - excludeSourceMaps: true // default 'true' - }) - ] + new WebpackMonitor({ + capture: true, // -> default 'true' + target: helpers.root("reports/webpack-monitor/stats.json"), // default -> '../monitor/stats.json' + launch: true, // -> default 'false' + port: 3030, // default 8081 + excludeSourceMaps: true // default 'true' + }) + ] : []), /** @@ -269,13 +272,13 @@ module.exports = metadata => { */ ...(BUNDLE_ANALYZER ? [ - new BundleAnalyzerPlugin({ - generateStatsFile: true, // default 'false' - statsFilename: helpers.root("reports/bundle-analyzer/stats.json"), // default -> 'stats.json' - openAnalyzer: true, //default 'true' - analyzerPort: 3030 // default 8888 - }) - ] + new BundleAnalyzerPlugin({ + generateStatsFile: true, // default 'false' + statsFilename: helpers.root("reports/bundle-analyzer/stats.json"), // default -> 'stats.json' + openAnalyzer: true, //default 'true' + analyzerPort: 3030 // default 8888 + }) + ] : []), /**