Skip to content

Commit

Permalink
fix(dev): build js modules for ts->js conversion
Browse files Browse the repository at this point in the history
The TS->JS migration was removed from the CLI codemod options, but still
used for TS->JS conversion when creating a new Remix project from the
CLI. The TS modules responsible for the TS->JS conversion were
incorrectly removed from the Rollup build, resulting in the
corresponding built JS modules being absent. That caused the CLI to
error when trying to perform TS->JS conversion. This changes
reintroduces the wiring to build the modules responsible for the TS->JS
conversion.

Fixes #4854
  • Loading branch information
pcattori committed Dec 16, 2022
1 parent e3224a6 commit 84a9c49
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/remix-dev/cli/migrate/migrations/transforms.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// escape-hatch to include these files in the build
export * as ConvertToJavaScriptTransform from "./convert-to-javascript/transform";
20 changes: 20 additions & 0 deletions packages/remix-dev/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,26 @@ module.exports = function rollup() {
],
},
getCliConfig({ packageName, version }),
{
external: (id) => isBareModuleId(id),
input: [`${sourceDir}/cli/migrate/migrations/transforms.ts`],
output: {
banner: createBanner("@remix-run/dev", version),
dir: `${outputDist}/cli/migrate/migrations`,
exports: "named",
format: "cjs",
preserveModules: true,
},
plugins: [
babel({
babelHelpers: "bundled",
exclude: /node_modules/,
extensions: [".ts"],
}),
nodeResolve({ extensions: [".ts"] }),
copyToPlaygrounds(),
],
},
{
external() {
return true;
Expand Down

0 comments on commit 84a9c49

Please sign in to comment.