Bring back babel (#3974)

* Bring back babel

* bump preset env

* Remove empty TS properties in mixins
This commit is contained in:
Bram Kragten
2019-10-19 14:06:04 +02:00
committed by GitHub
parent c437cd3865
commit d05dc2e4dc
10 changed files with 184 additions and 204 deletions

View File

@@ -9,43 +9,6 @@ const buildPath = path.resolve(__dirname, "dist");
const publicPath = isProd ? "./" : "http://localhost:8080/";
const latestBuild = true;
const rules = [
{
exclude: [path.resolve(__dirname, "../node_modules")],
test: /\.ts$/,
use: [
{
loader: "ts-loader",
options: {
compilerOptions: latestBuild
? { noEmit: false }
: {
target: "es5",
noEmit: false,
},
},
},
],
},
{
test: /\.css$/,
use: "raw-loader",
},
{
test: /\.(html)$/,
use: {
loader: "html-loader",
options: {
exportAsEs6Default: true,
},
},
},
];
if (!latestBuild) {
rules.push(babelLoaderConfig({ latestBuild }));
}
module.exports = {
mode: isProd ? "production" : "development",
// Disabled in prod while we make Home Assistant able to serve the right files.
@@ -53,7 +16,22 @@ module.exports = {
devtool: isProd ? "none" : "inline-source-map",
entry: "./src/entrypoint.js",
module: {
rules,
rules: [
babelLoaderConfig({ latestBuild }),
{
test: /\.css$/,
use: "raw-loader",
},
{
test: /\.(html)$/,
use: {
loader: "html-loader",
options: {
exportAsEs6Default: true,
},
},
},
],
},
optimization: webpackBase.optimization(latestBuild),
plugins: [