Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix generate sourcemap #946

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions scripts/rollup/history.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import replace from "@rollup/plugin-replace";
import { terser } from "rollup-plugin-terser";
import typescript from "rollup-plugin-typescript2";

const PRETTY = !!process.env.PRETTY;
const PRETTY = process.env.PRETTY === 'true';
const SOURCE_DIR = "packages/history";
const OUTPUT_DIR = "build/history";

Expand All @@ -15,14 +15,15 @@ const modules = [
output: {
file: `${OUTPUT_DIR}/index.js`,
format: "esm",
sourcemap: !PRETTY,
sourcemap: PRETTY,
},
external: ["@babel/runtime/helpers/esm/extends"],
plugins: [
typescript({
tsconfigDefaults: {
compilerOptions: {
declaration: true,
sourceMap: PRETTY,
},
},
}),
Expand Down Expand Up @@ -52,13 +53,14 @@ const modules = [
output: {
file: `${OUTPUT_DIR}/${env}.js`,
format: "esm",
sourcemap: !PRETTY,
sourcemap: PRETTY,
},
plugins: [
typescript({
tsconfigDefaults: {
compilerOptions: {
declaration: true,
sourceMap: PRETTY,
},
},
}),
Expand All @@ -80,13 +82,14 @@ const webModules = [
output: {
file: `${OUTPUT_DIR}/history.development.js`,
format: "esm",
sourcemap: !PRETTY,
sourcemap: PRETTY,
},
plugins: [
typescript({
tsconfigOverride: {
compilerOptions: {
target: "es2016",
sourceMap: PRETTY,
},
},
}),
Expand All @@ -108,13 +111,14 @@ const webModules = [
output: {
file: `${OUTPUT_DIR}/history.production.min.js`,
format: "esm",
sourcemap: !PRETTY,
sourcemap: PRETTY,
},
plugins: [
typescript({
tsconfigOverride: {
compilerOptions: {
target: "es2016",
sourceMap: PRETTY,
},
},
}),
Expand All @@ -140,11 +144,17 @@ const globals = [
output: {
file: `${OUTPUT_DIR}/umd/history.development.js`,
format: "umd",
sourcemap: !PRETTY,
sourcemap: PRETTY,
name: "HistoryLibrary",
},
plugins: [
typescript(),
typescript({
tsconfigOverride: {
compilerOptions: {
sourceMap: PRETTY,
},
},
}),
babel({
exclude: /node_modules/,
extensions: [".ts"],
Expand All @@ -163,11 +173,17 @@ const globals = [
output: {
file: `${OUTPUT_DIR}/umd/history.production.min.js`,
format: "umd",
sourcemap: !PRETTY,
sourcemap: PRETTY,
name: "HistoryLibrary",
},
plugins: [
typescript(),
typescript({
tsconfigOverride: {
compilerOptions: {
sourceMap: PRETTY,
},
},
}),
babel({
exclude: /node_modules/,
extensions: [".ts"],
Expand Down