File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed
Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 11import { defineBuildConfig } from 'unbuild' ;
22
33// Build Config for the Nuxt Module Builder: https://github.com/nuxt/module-builder
4- export default defineBuildConfig ( {
5- failOnWarn : false ,
6- } ) ;
4+ export default defineBuildConfig ( { } ) ;
Original file line number Diff line number Diff line change 1+ # The Nuxt package is built in 2 steps and the nuxt-module-builder shows a warning if one of the files specified in the package.json is missing.
2+ # unbuild checks for this: https://github.com/unjs/unbuild/blob/8c647ec005a02f852e56aeef6076a35eede17df1/src/validate.ts#L81
3+
4+ # The runtime folder (which is built with the nuxt-module-builder) is separate from the rest of the package and therefore we can ignore those warnings
5+ # as those files are generated in the other build step.
6+
7+ # Create the directories if they do not exist
8+ mkdir -p build/cjs
9+ mkdir -p build/esm
10+ mkdir -p build/types
11+
12+ # Write files if they do not exist
13+ [ ! -f build/cjs/index.server.js ] && echo " module.exports = {}" > build/cjs/index.server.js
14+ [ ! -f build/cjs/index.client.js ] && echo " module.exports = {}" > build/cjs/index.client.js
15+ [ ! -f build/esm/index.server.js ] && echo " export {}" > build/esm/index.server.js
16+ [ ! -f build/esm/index.client.js ] && echo " export {}" > build/esm/index.client.js
17+ [ ! -f build/types/index.types.d.ts ] && echo " export {}" > build/types/index.types.d.ts
18+
19+ echo " Created build stubs for missing files"
Original file line number Diff line number Diff line change 5858 "scripts" : {
5959 "build" : " run-s build:types build:transpile" ,
6060 "build:dev" : " yarn build" ,
61- "build:nuxt-module" : " nuxt-module-build build --outDir build/module" ,
61+ "build:nuxt-module" : " bash ./generate-build-stubs.bash && nuxt-module-build build --outDir build/module" ,
6262 "build:transpile" : " rollup -c rollup.npm.config.mjs && yarn build:nuxt-module" ,
6363 "build:types" : " tsc -p tsconfig.types.json" ,
6464 "build:watch" : " run-p build:transpile:watch build:types:watch" ,
You can’t perform that action at this time.
0 commit comments