Skip to content

Commit

Permalink
fix: build for nextjs 13
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhuugiatri committed Sep 19, 2024
1 parent 52f37bd commit a17e7a8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
5 changes: 1 addition & 4 deletions packages/waypoint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"repository": {
"url": "https://github.com/skymavis/waypoint-js"
},
"version": "2.0.0",
"version": "0.0.0",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -19,9 +19,6 @@
"main": "dist/cjs/index.js",
"module": "dist/mjs/index.js",
"types": "./dist/types/index.d.ts",
"sideEffects": [
"*.css"
],
"files": [
"dist",
"README.md"
Expand Down
28 changes: 0 additions & 28 deletions packages/waypoint/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,36 +1,10 @@
import { babel } from "@rollup/plugin-babel"
import commonjs from "@rollup/plugin-commonjs"
import { nodeResolve } from "@rollup/plugin-node-resolve"
import fsExtra from "fs-extra"
import path, { dirname } from "path"
import { defineConfig } from "rollup"
import peerDepsExternal from "rollup-plugin-peer-deps-external"
import nodePolyfills from "rollup-plugin-polyfill-node"
import typescript from "rollup-plugin-typescript2"
import { fileURLToPath } from "url"

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

function fixPackageJson() {
return {
name: "fix-package-json",
async closeBundle() {
try {
fsExtra.outputJsonSync(path.join(__dirname, "dist/mjs", "package.json"), {
type: "module",
sideEffects: ["*.css"],
})
fsExtra.outputJsonSync(path.join(__dirname, "dist/cjs", "package.json"), {
type: "commonjs",
sideEffects: ["*.css"],
})
} catch (error) {
console.error("[fixPackageJson]", error)
}
},
}
}

const mainConfig = defineConfig({
input: ["src/index.ts"],
Expand Down Expand Up @@ -75,8 +49,6 @@ const mainConfig = defineConfig({
],
babelHelpers: "bundled",
}),

fixPackageJson(),
],
})

Expand Down

0 comments on commit a17e7a8

Please sign in to comment.