mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-31 01:12:48 -05:00
Apply babel config to all files processed in each bundle
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"presets": ["@babel/preset-env"],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@babel/plugin-proposal-optional-chaining",
|
"@babel/plugin-proposal-optional-chaining",
|
||||||
"babel-plugin-styled-components",
|
"babel-plugin-styled-components",
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"presets": [
|
|
||||||
[
|
|
||||||
"@babel/preset-env",
|
|
||||||
{
|
|
||||||
"targets": {
|
|
||||||
"electron": "9"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"presets": [
|
|
||||||
[
|
|
||||||
"@babel/preset-env",
|
|
||||||
{
|
|
||||||
"modules": "commonjs",
|
|
||||||
"targets": {
|
|
||||||
"node": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"presets": [
|
|
||||||
[
|
|
||||||
"@babel/preset-env",
|
|
||||||
{
|
|
||||||
"modules": "commonjs",
|
|
||||||
"targets": "> 0.25%, not dead"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,14 +1,17 @@
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
const CopyPlugin = require('copy-webpack-plugin')
|
const CopyPlugin = require('copy-webpack-plugin')
|
||||||
|
|
||||||
const baseConfig = {
|
const baseConfig = ({ babel }) => ({
|
||||||
mode: 'development',
|
mode: 'development',
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.jsx?$/,
|
test: /\.jsx?$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
loader: 'babel-loader',
|
use: {
|
||||||
|
loader: 'babel-loader',
|
||||||
|
options: babel,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.css$/i,
|
test: /\.css$/i,
|
||||||
@@ -40,10 +43,22 @@ const baseConfig = {
|
|||||||
'react-dom': 'preact/compat',
|
'react-dom': 'preact/compat',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
|
|
||||||
const nodeConfig = {
|
const nodeConfig = {
|
||||||
...baseConfig,
|
...baseConfig({
|
||||||
|
babel: {
|
||||||
|
presets: [
|
||||||
|
[
|
||||||
|
'@babel/preset-env',
|
||||||
|
{
|
||||||
|
modules: 'commonjs',
|
||||||
|
targets: { node: true },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}),
|
||||||
target: 'electron-main',
|
target: 'electron-main',
|
||||||
entry: {
|
entry: {
|
||||||
index: './src/node/index.js',
|
index: './src/node/index.js',
|
||||||
@@ -54,7 +69,11 @@ const nodeConfig = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const browserConfig = {
|
const browserConfig = {
|
||||||
...baseConfig,
|
...baseConfig({
|
||||||
|
babel: {
|
||||||
|
presets: [['@babel/preset-env', { targets: { electron: '9' } }]],
|
||||||
|
},
|
||||||
|
}),
|
||||||
devtool: 'cheap-source-map',
|
devtool: 'cheap-source-map',
|
||||||
target: 'electron-renderer',
|
target: 'electron-renderer',
|
||||||
entry: {
|
entry: {
|
||||||
@@ -68,7 +87,19 @@ const browserConfig = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const webConfig = {
|
const webConfig = {
|
||||||
...baseConfig,
|
...baseConfig({
|
||||||
|
babel: {
|
||||||
|
presets: [
|
||||||
|
[
|
||||||
|
'@babel/preset-env',
|
||||||
|
{
|
||||||
|
modules: 'commonjs',
|
||||||
|
targets: '> 0.25%, not dead',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}),
|
||||||
devtool: 'cheap-source-map',
|
devtool: 'cheap-source-map',
|
||||||
target: 'web',
|
target: 'web',
|
||||||
entry: {
|
entry: {
|
||||||
|
|||||||
Reference in New Issue
Block a user