mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-08 02:19:43 +00:00
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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user