Skip to content

Commit

Permalink
fix: fix bundle sourmap not work problem #81
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Mar 30, 2024
1 parent e92da15 commit 642e992
Show file tree
Hide file tree
Showing 4 changed files with 1,764 additions and 2,086 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
pnpm lint-staged
5 changes: 3 additions & 2 deletions mini-star/bundler/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function buildRollupOptions(
const scope = config.scope;
const name = packageConfig.name.replace(`@${scope}/`, '');
const main = packageConfig.main;
const sourceMap = config.sourceMap ?? true;

const prefixDepsMatch = [
...getPluginDirs().map((x) => `@plugins/${x}`),
Expand All @@ -51,7 +52,7 @@ export function buildRollupOptions(
// All options are optional
include: /\.[jt]sx?$/, // default, inferred from `loaders` option
exclude: /node_modules/, // default
sourceMap: config.sourceMap ?? true, // default is true
sourceMap: sourceMap, // default is true
minify: process.env.NODE_ENV === 'production',
tsconfig: path.resolve(
path.dirname(pluginPackageJsonPath),
Expand Down Expand Up @@ -117,7 +118,7 @@ export function buildRollupOptions(
basePath: `@plugins/${name}`,
define: 'definePlugin',
},
sourcemap: true,
sourcemap: sourceMap,
},
plugins,
external: (id: string) => {
Expand Down
3 changes: 2 additions & 1 deletion mini-star/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "mini-star",
"version": "2.1.6",
"version": "2.1.8",
"description": "",
"main": "./lib/runtime/index.js",
"scripts": {
"dev": "tsc -p ./tsconfig.build.json --watch",
"build": "rimraf ./lib/**/*.d.ts && tsc -p ./tsconfig.build.json",
"build:browser": "rollup --config rollup.browser.ts --configPlugin typescript",
"crlf": "npx crlf --set=LF ./lib/**/*.js",
Expand Down
Loading

0 comments on commit 642e992

Please sign in to comment.