-
-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trying to get bili to work with TypeScript
Generates error: ``` $ /Users/mweststrate/Desktop/immer/node_modules/.bin/bili error Failed to bundle src/index.ts in cjs format Stack Trace: TypeError: this.emitFile is not a function at emitDeclaration (/Users/mweststrate/Desktop/immer/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27461:26) at lodash_3 (/Users/mweststrate/Desktop/immer/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27469:17) at /Users/mweststrate/Desktop/immer/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:4923:15 at baseForOwn (/Users/mweststrate/Desktop/immer/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:3008:24) at /Users/mweststrate/Desktop/immer/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:4892:18 at forEach (/Users/mweststrate/Desktop/immer/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:9360:14) at Object._onwrite (/Users/mweststrate/Desktop/immer/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27468:13) at Object.generateBundle (/Users/mweststrate/Desktop/immer/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27402:27) at /Users/mweststrate/Desktop/immer/node_modules/rollup/dist/rollup.js:17067:25 error Command failed with exit code 1. ```
- Loading branch information
1 parent
82d00cc
commit 4377dcd
Showing
4 changed files
with
148 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import {Config} from "bili" | ||
|
||
const config: Config = { | ||
input: { | ||
immer: "src/index.js" | ||
}, | ||
output: { | ||
format: ["cjs", "umd", "esm"], | ||
moduleName: "immer", | ||
sourceMap: true, | ||
sourceMapExcludeSources: true | ||
}, | ||
babel: { | ||
// Replace babel-preset-env with buble | ||
minimal: true, | ||
babelrc: false | ||
}, | ||
extendConfig(config, {format}) { | ||
if (format === "umd") { | ||
config.output.minify = true | ||
} | ||
if (format === "esm") { | ||
config.output.fileName = "[name].module.js" | ||
} | ||
return config | ||
} | ||
input: { | ||
immer: "src/index.ts" | ||
}, | ||
output: { | ||
format: ["cjs", "umd", "esm"], | ||
moduleName: "immer", | ||
sourceMap: true, | ||
sourceMapExcludeSources: true | ||
}, | ||
babel: { | ||
// Replace babel-preset-env with buble | ||
minimal: true, | ||
babelrc: false | ||
}, | ||
extendConfig(config, {format}) { | ||
if (format === "umd") { | ||
config.output.minify = true | ||
} | ||
if (format === "esm") { | ||
config.output.fileName = "[name].module.js" | ||
} | ||
return config | ||
} | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters