Skip to content

Commit

Permalink
fix(schema-formio): make package compatible with browser context
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Dec 27, 2022
1 parent 975eb10 commit 959764d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 4 deletions.
8 changes: 6 additions & 2 deletions packages/third-parties/schema-formio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
"typings": "./lib/types/index.d.ts",
"browser": "./lib/browser/schema-formio.umd.min.js",
"exports": {
"types": "./lib/types/index.d.ts",
"browser": "./lib/browser/schema-formio.umd.min.js",
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js",
"default": "./lib/esm/index.js"
},
"scripts": {
"build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
"clean": "rm -rf lib",
"build": "yarn clean && yarn barrels && yarn run build:esm && yarn run build:cjs && yarn run build:browser",
"build:cjs": "tsc --build tsconfig.compile.json",
"build:esm": "tsc --build tsconfig.compile.esm.json",
"build:browser": "webpack",
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
"test": "cross-env NODE_ENV=test jest"
},
Expand Down Expand Up @@ -70,4 +74,4 @@
"optional": false
}
}
}
}
14 changes: 13 additions & 1 deletion packages/third-parties/schema-formio/tsconfig.compile.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,17 @@
"declaration": true,
"declarationDir": "./lib/types"
},
"exclude": ["node_modules", "test", "lib", "benchmark", "coverage", "spec", "**/*.benchmark.ts", "**/*.spec.ts", "keys", "jest.config.js"]
"exclude": [
"node_modules",
"test",
"lib",
"benchmark",
"coverage",
"spec",
"**/*.benchmark.ts",
"**/*.spec.ts",
"keys",
"jest.config.js",
"webpack.config.js"
]
}
14 changes: 13 additions & 1 deletion packages/third-parties/schema-formio/tsconfig.compile.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,17 @@
"outDir": "lib/cjs",
"declaration": false
},
"exclude": ["node_modules", "test", "lib", "benchmark", "coverage", "spec", "**/*.benchmark.ts", "**/*.spec.ts", "keys", "jest.config.js"]
"exclude": [
"node_modules",
"test",
"lib",
"benchmark",
"coverage",
"spec",
"**/*.benchmark.ts",
"**/*.spec.ts",
"keys",
"jest.config.js",
"webpack.config.js"
]
}
16 changes: 16 additions & 0 deletions packages/third-parties/schema-formio/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = require("@tsed/webpack-config").create({
root: __dirname,
name: "schema-formio",
externals: {
"@tsed/core": "@tsed/core",
"@tsed/schema": "@tsed/schema",
formiojs: "formiojs",
lodash: "lodash",
moment: "moment"
},
resolve: {
alias: {
picomatch: require.resolve("picomatch-browser/posix")
}
}
});

0 comments on commit 959764d

Please sign in to comment.