Skip to content

Commit

Permalink
Align remixBabelConfig and noForceEmit across packages
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Oct 16, 2024
1 parent 5d05ee8 commit 421d5cd
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 15 deletions.
7 changes: 4 additions & 3 deletions packages/react-router-architect/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const {
getBuildDirectories,
createBanner,
WATCH,
remixBabelConfig,
} = require("../../rollup.utils");
const { name: packageName, version } = require("./package.json");

Expand All @@ -23,9 +24,7 @@ module.exports = function rollup() {

return [
{
external(id) {
return isBareModuleId(id);
},
external: (id) => isBareModuleId(id),
input: `${SOURCE_DIR}/index.ts`,
output: {
banner: createBanner(packageName, version),
Expand All @@ -39,11 +38,13 @@ module.exports = function rollup() {
babelHelpers: "bundled",
exclude: /node_modules/,
extensions: [".ts"],
...remixBabelConfig,
}),
typescript({
tsconfig: path.join(__dirname, "tsconfig.json"),
exclude: ["__tests__"],
noEmitOnError: !WATCH,
noForceEmit: true,
}),
nodeResolve({ extensions: [".ts"] }),
copy({
Expand Down
5 changes: 2 additions & 3 deletions packages/react-router-cloudflare/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ module.exports = function rollup() {

return [
{
external(id) {
return isBareModuleId(id);
},
external: (id) => isBareModuleId(id),
input: `${SOURCE_DIR}/index.ts`,
output: {
banner: createBanner(packageName, version),
Expand All @@ -45,6 +43,7 @@ module.exports = function rollup() {
typescript({
tsconfig: path.join(__dirname, "tsconfig.json"),
noEmitOnError: !WATCH,
noForceEmit: true,
}),
nodeResolve({ extensions: [".ts"] }),
copy({
Expand Down
1 change: 1 addition & 0 deletions packages/react-router-express/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module.exports = function rollup() {
tsconfig: path.join(__dirname, "tsconfig.json"),
exclude: ["__tests__"],
noEmitOnError: !WATCH,
noForceEmit: true,
}),
nodeResolve({ extensions: [".ts", ".tsx"] }),
copy({
Expand Down
3 changes: 3 additions & 0 deletions packages/react-router-fs-routes/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const {
createBanner,
getBuildDirectories,
WATCH,
remixBabelConfig,
} = require("../../rollup.utils");
const { name, version } = require("./package.json");

Expand Down Expand Up @@ -36,11 +37,13 @@ module.exports = function rollup() {
babelHelpers: "bundled",
exclude: /node_modules/,
extensions: [".ts"],
...remixBabelConfig,
}),
typescript({
tsconfig: path.join(__dirname, "tsconfig.json"),
exclude: ["__tests__"],
noEmitOnError: !WATCH,
noForceEmit: true,
}),
nodeResolve({ extensions: [".ts"] }),
copy({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const {
createBanner,
getBuildDirectories,
WATCH,
remixBabelConfig,
} = require("../../rollup.utils");
const { name, version } = require("./package.json");

Expand Down Expand Up @@ -36,11 +37,13 @@ module.exports = function rollup() {
babelHelpers: "bundled",
exclude: /node_modules/,
extensions: [".ts"],
...remixBabelConfig,
}),
typescript({
tsconfig: path.join(__dirname, "tsconfig.json"),
exclude: ["__tests__"],
noEmitOnError: !WATCH,
noForceEmit: true,
}),
nodeResolve({ extensions: [".ts"] }),
copy({
Expand Down
1 change: 1 addition & 0 deletions packages/react-router-serve/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = function rollup() {
tsconfig: path.join(__dirname, "tsconfig.json"),
exclude: ["__tests__"],
noEmitOnError: !WATCH,
noForceEmit: true,
}),
nodeResolve({ extensions: [".ts"] }),
copy({
Expand Down
2 changes: 2 additions & 0 deletions packages/react-router/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ module.exports = function rollup() {
// eslint-disable-next-line no-restricted-globals
tsconfig: path.join(__dirname, "tsconfig.dom.json"),
noEmitOnError: !WATCH,
noForceEmit: true,
}),
].concat(PRETTY ? prettier({ parser: "babel" }) : []),
},
Expand Down Expand Up @@ -122,6 +123,7 @@ module.exports = function rollup() {
// eslint-disable-next-line no-restricted-globals
tsconfig: path.join(__dirname, "tsconfig.dom.json"),
noEmitOnError: !WATCH,
noForceEmit: true,
}),
],
},
Expand Down
9 changes: 0 additions & 9 deletions rollup.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,6 @@ const remixBabelConfig = {
plugins: [
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-optional-chaining",
// Strip console.debug calls unless REACT_ROUTER_DEBUG=true
...(process.env.REACT_ROUTER_DEBUG === "true"
? []
: [
[
"transform-remove-console",
{ exclude: ["error", "warn", "log", "info"] },
],
]),
],
};

Expand Down

0 comments on commit 421d5cd

Please sign in to comment.