mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 10:16:46 +00:00
Revert "Use ES modules and dynamic import for Webpack latest builds (… (#16679)
Revert "Use ES modules and dynamic import for Webpack latest builds (#16620)" This reverts commit 7b350e31dd9a313d1023d2049d9513f58d38e8de.
This commit is contained in:
parent
5218e1352e
commit
d914fb0cfc
@ -10,12 +10,6 @@ supports es6-module-dynamic-import
|
|||||||
not Safari < 13
|
not Safari < 13
|
||||||
not iOS < 13
|
not iOS < 13
|
||||||
|
|
||||||
# Exclude KaiOS, QQ, and UC browsers due to lack of sufficient feature support data
|
|
||||||
# Babel ignores these automatically, but we need here for Webpack to output ESM with dynamic imports
|
|
||||||
not KaiOS > 0
|
|
||||||
not QQAndroid > 0
|
|
||||||
not UCAndroid > 0
|
|
||||||
|
|
||||||
# Exclude unsupported browsers
|
# Exclude unsupported browsers
|
||||||
not dead
|
not dead
|
||||||
|
|
||||||
|
@ -77,7 +77,6 @@ module.exports.htmlMinifierOptions = {
|
|||||||
module.exports.terserOptions = ({ latestBuild, isTestBuild }) => ({
|
module.exports.terserOptions = ({ latestBuild, isTestBuild }) => ({
|
||||||
safari10: !latestBuild,
|
safari10: !latestBuild,
|
||||||
ecma: latestBuild ? 2015 : 5,
|
ecma: latestBuild ? 2015 : 5,
|
||||||
module: latestBuild,
|
|
||||||
format: { comments: false },
|
format: { comments: false },
|
||||||
sourceMap: !isTestBuild,
|
sourceMap: !isTestBuild,
|
||||||
});
|
});
|
||||||
|
@ -41,7 +41,7 @@ const createWebpackConfig = ({
|
|||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
mode: isProdBuild ? "production" : "development",
|
mode: isProdBuild ? "production" : "development",
|
||||||
target: `browserslist:${latestBuild ? "modern" : "legacy"}`,
|
target: ["web", latestBuild ? "es2017" : "es5"],
|
||||||
// For tests/CI, source maps are skipped to gain build speed
|
// For tests/CI, source maps are skipped to gain build speed
|
||||||
// For production, generate source maps for accurate stack traces without source code
|
// For production, generate source maps for accurate stack traces without source code
|
||||||
// For development, generate "cheap" versions that can map to original line numbers
|
// For development, generate "cheap" versions that can map to original line numbers
|
||||||
@ -163,7 +163,6 @@ const createWebpackConfig = ({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
module: latestBuild,
|
|
||||||
filename: ({ chunk }) =>
|
filename: ({ chunk }) =>
|
||||||
!isProdBuild || isStatsBuild || dontHash.has(chunk.name)
|
!isProdBuild || isStatsBuild || dontHash.has(chunk.name)
|
||||||
? "[name].js"
|
? "[name].js"
|
||||||
@ -197,7 +196,7 @@ const createWebpackConfig = ({
|
|||||||
: undefined,
|
: undefined,
|
||||||
},
|
},
|
||||||
experiments: {
|
experiments: {
|
||||||
outputModule: true,
|
topLevelAwait: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,13 +1,8 @@
|
|||||||
import webpack from "../build-scripts/webpack.cjs";
|
import webpack from "../build-scripts/webpack.cjs";
|
||||||
|
|
||||||
const config = webpack.createAppConfig({
|
export default webpack.createAppConfig({
|
||||||
isProdBuild: false,
|
isProdBuild: false,
|
||||||
latestBuild: true,
|
latestBuild: true,
|
||||||
isStatsBuild: false,
|
isStatsBuild: false,
|
||||||
isTestBuild: true,
|
isTestBuild: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
// instant-mocha forces a CJS library, so cannot output ESM
|
|
||||||
config.output.module = false;
|
|
||||||
|
|
||||||
export default config;
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user