mirror of
https://github.com/home-assistant/frontend.git
synced 2025-10-23 02:29:44 +00:00
Bring back babel (#3974)
* Bring back babel * bump preset env * Remove empty TS properties in mixins
This commit is contained in:
@@ -41,20 +41,6 @@ const resolve = {
|
||||
},
|
||||
};
|
||||
|
||||
const tsLoader = (latestBuild) => ({
|
||||
test: /\.ts|tsx$/,
|
||||
exclude: [path.resolve(paths.polymer_dir, "node_modules")],
|
||||
use: [
|
||||
{
|
||||
loader: "ts-loader",
|
||||
options: {
|
||||
compilerOptions: latestBuild
|
||||
? { noEmit: false }
|
||||
: { target: "es5", noEmit: false },
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
const cssLoader = {
|
||||
test: /\.css$/,
|
||||
use: "raw-loader",
|
||||
@@ -127,17 +113,12 @@ const createAppConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => {
|
||||
"hass-icons": "./src/entrypoints/hass-icons.ts",
|
||||
};
|
||||
|
||||
const rules = [tsLoader(latestBuild), cssLoader, htmlLoader];
|
||||
if (!latestBuild) {
|
||||
rules.push(babelLoaderConfig({ latestBuild }));
|
||||
}
|
||||
|
||||
return {
|
||||
mode: genMode(isProdBuild),
|
||||
devtool: genDevTool(isProdBuild),
|
||||
entry,
|
||||
module: {
|
||||
rules,
|
||||
rules: [babelLoaderConfig({ latestBuild }), cssLoader, htmlLoader],
|
||||
},
|
||||
optimization: optimization(latestBuild),
|
||||
plugins: [
|
||||
@@ -197,11 +178,6 @@ const createAppConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => {
|
||||
};
|
||||
|
||||
const createDemoConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => {
|
||||
const rules = [tsLoader(latestBuild), cssLoader, htmlLoader];
|
||||
if (!latestBuild) {
|
||||
rules.push(babelLoaderConfig({ latestBuild }));
|
||||
}
|
||||
|
||||
return {
|
||||
mode: genMode(isProdBuild),
|
||||
devtool: genDevTool(isProdBuild),
|
||||
@@ -210,7 +186,7 @@ const createDemoConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => {
|
||||
compatibility: "./src/entrypoints/compatibility.ts",
|
||||
},
|
||||
module: {
|
||||
rules,
|
||||
rules: [babelLoaderConfig({ latestBuild }), cssLoader, htmlLoader],
|
||||
},
|
||||
optimization: optimization(latestBuild),
|
||||
plugins: [
|
||||
@@ -252,17 +228,12 @@ const createCastConfig = ({ isProdBuild, latestBuild }) => {
|
||||
entry.receiver = "./cast/src/receiver/entrypoint.ts";
|
||||
}
|
||||
|
||||
const rules = [tsLoader(latestBuild), cssLoader, htmlLoader];
|
||||
if (!latestBuild) {
|
||||
rules.push(babelLoaderConfig({ latestBuild }));
|
||||
}
|
||||
|
||||
return {
|
||||
mode: genMode(isProdBuild),
|
||||
devtool: genDevTool(isProdBuild),
|
||||
entry,
|
||||
module: {
|
||||
rules,
|
||||
rules: [babelLoaderConfig({ latestBuild }), cssLoader, htmlLoader],
|
||||
},
|
||||
optimization: optimization(latestBuild),
|
||||
plugins: [
|
||||
|
Reference in New Issue
Block a user