Skip to content

Commit 16e1e5f

Browse files
author
Michael Pinter
committed
Fixed issue with babel not building resources correctly with node preset
1 parent 2500f2b commit 16e1e5f

File tree

4 files changed

+41
-17
lines changed

4 files changed

+41
-17
lines changed

.babelrc

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1 @@
1-
{
2-
"presets": [
3-
[
4-
"env",
5-
{
6-
"targets": {
7-
"node": "current"
8-
}
9-
}
10-
]
11-
]
12-
}
1+
{}

install.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"dns": [
2121
{
2222
"type": "TXT",
23-
"content": "example",
24-
"name": "example",
23+
"content": "Managed TXT Record",
24+
"name": "Created by create-cloudflare-app",
2525
"ttl": 120
2626
}
2727
],

webpack.config.js

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const isDev = process.env.NODE_ENV !== "production"
55

66
module.exports = {
77
mode: "development",
8-
devtool: "nosources-source-map",
8+
devtool: "hidden-source-map",
99
entry: {
1010
index: "./src/index.js",
1111
worker: "./workers/worker.js",
@@ -23,11 +23,40 @@ module.exports = {
2323
module: {
2424
rules: [
2525
{
26-
test: /\.js$/,
26+
test: /src\/.*\.js$/,
2727
loader: "babel-loader",
2828
exclude: /(node_modules)/,
2929
options: {
3030
compact: false,
31+
presets: [
32+
[
33+
"env",
34+
{
35+
targets: {
36+
browsers: ["last 2 versions", "ie >= 10"],
37+
},
38+
},
39+
],
40+
],
41+
},
42+
},
43+
44+
{
45+
test: /workers\/.*\.js$/,
46+
loader: "babel-loader",
47+
exclude: /(node_modules)/,
48+
options: {
49+
compact: false,
50+
presets: [
51+
[
52+
"env",
53+
{
54+
targets: {
55+
node: "current",
56+
},
57+
},
58+
],
59+
],
3160
},
3261
},
3362

yarn.lock

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ babel-plugin-syntax-trailing-function-commas@^6.22.0:
556556
version "6.22.0"
557557
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3"
558558

559-
babel-plugin-transform-async-to-generator@^6.22.0:
559+
babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.24.1:
560560
version "6.24.1"
561561
resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761"
562562
dependencies:
@@ -746,6 +746,12 @@ babel-plugin-transform-regenerator@^6.22.0:
746746
dependencies:
747747
regenerator-transform "^0.10.0"
748748

749+
babel-plugin-transform-runtime@^6.23.0:
750+
version "6.23.0"
751+
resolved "https://registry.yarnpkg.com/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz#88490d446502ea9b8e7efb0fe09ec4d99479b1ee"
752+
dependencies:
753+
babel-runtime "^6.22.0"
754+
749755
babel-plugin-transform-strict-mode@^6.24.1:
750756
version "6.24.1"
751757
resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758"

0 commit comments

Comments
 (0)