Embed the preact code directly (#1177)

* Embed the preact code directly

* Do not transform object rest spread

* Lint

* Ignore preact from lint
This commit is contained in:
Paulus Schoutsen
2018-05-15 17:56:32 -04:00
committed by GitHub
parent 47642957c8
commit 96d7ec7cda
30 changed files with 162 additions and 151 deletions

View File

@@ -10,23 +10,23 @@ function createConfig(isProdBuild, latestBuild) {
publicPath = `/home-assistant-polymer/${buildPath}`;
}
const rules = [];
if (!latestBuild) {
rules.push({
test: /\.js$/,
use: {
loader: 'babel-loader',
options: {
presets: [
['es2015', { modules: false }]
],
plugins: [
// Only support the syntax, Webpack will handle it.
"syntax-dynamic-import"
],
const babelOptions = {
plugins: [
// Only support the syntax, Webpack will handle it.
"syntax-dynamic-import",
[
'transform-react-jsx',
{
pragma: 'h'
}
}
});
],
],
};
if (!latestBuild) {
babelOptions.presets = [
['es2015', { modules: false }]
];
}
const chunkFilename = isProdBuild ?
@@ -39,7 +39,15 @@ function createConfig(isProdBuild, latestBuild) {
authorize: './src/auth/ha-authorize.js'
},
module: {
rules
rules: [
{
test: /\.js$/,
use: {
loader: 'babel-loader',
options: babelOptions,
},
}
]
},
output: {
filename: '[name].js',