mirror of
https://github.com/streamwall/streamwall.git
synced 2025-12-06 01:45:37 -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": [
|
||||
"@babel/plugin-proposal-optional-chaining",
|
||||
"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 CopyPlugin = require('copy-webpack-plugin')
|
||||
|
||||
const baseConfig = {
|
||||
const baseConfig = ({ babel }) => ({
|
||||
mode: 'development',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'babel-loader',
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: babel,
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
@@ -40,10 +43,22 @@ const baseConfig = {
|
||||
'react-dom': 'preact/compat',
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
const nodeConfig = {
|
||||
...baseConfig,
|
||||
...baseConfig({
|
||||
babel: {
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
modules: 'commonjs',
|
||||
targets: { node: true },
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
}),
|
||||
target: 'electron-main',
|
||||
entry: {
|
||||
index: './src/node/index.js',
|
||||
@@ -54,7 +69,11 @@ const nodeConfig = {
|
||||
}
|
||||
|
||||
const browserConfig = {
|
||||
...baseConfig,
|
||||
...baseConfig({
|
||||
babel: {
|
||||
presets: [['@babel/preset-env', { targets: { electron: '9' } }]],
|
||||
},
|
||||
}),
|
||||
devtool: 'cheap-source-map',
|
||||
target: 'electron-renderer',
|
||||
entry: {
|
||||
@@ -68,7 +87,19 @@ const browserConfig = {
|
||||
}
|
||||
|
||||
const webConfig = {
|
||||
...baseConfig,
|
||||
...baseConfig({
|
||||
babel: {
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
modules: 'commonjs',
|
||||
targets: '> 0.25%, not dead',
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
}),
|
||||
devtool: 'cheap-source-map',
|
||||
target: 'web',
|
||||
entry: {
|
||||
|
||||
Reference in New Issue
Block a user