Skip to content

Commit

Permalink
added build fixes from main to 1.70 (#6360)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpal81xd authored May 14, 2024
1 parent 6fdbcad commit cf5254b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ function getEnginePathFiles() {
function checkAppEngine() {
// types
if (!fs.existsSync('../build/playcanvas.d.ts')) {
const cmd = `npm run build:types --prefix ../`;
const cmd = `npm run build target:types --prefix ../`;
console.log("\x1b[32m%s\x1b[0m", cmd);
execSync(cmd);
}

// engine
if (!fs.existsSync('../build/playcanvas/src/index.js')) {
const cmd = `npm run build:esm:release --prefix ../`;
const cmd = `npm run build target:esm:release --prefix ../`;
console.log("\x1b[32m%s\x1b[0m", cmd);
execSync(cmd);
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
"types": "build/playcanvas.d.ts",
"exports": {
".": {
"require": "./build/playcanvas.js",
"import": "./build/playcanvas/src/index.js",
"require": "./build/playcanvas.js"
"types": "./build/playcanvas.d.ts"
},
"./build/*": "./build/*"
},
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const MODULE_FORMAT = ['umd', 'esm'];
* @type {RollupOptions[]}
*/
const TYPES_TARGET = [{
input: 'build/playcanvas/index.d.ts',
input: 'build/playcanvas/src/index.d.ts',
output: [{
file: 'build/playcanvas.d.ts',
footer: 'export as namespace pc;\nexport as namespace pcx;',
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"allowJs": true,
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "build/playcanvas"
"outDir": "build/playcanvas/src"
}
}
2 changes: 1 addition & 1 deletion utils/plugins/rollup-types-fixup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const GREEN_OUT = '\x1b[32m';
const BOLD_OUT = `\x1b[1m`;
const REGULAR_OUT = `\x1b[22m`;

const TYPES_PATH = './build/playcanvas';
const TYPES_PATH = './build/playcanvas/src';

const STANDARD_MAT_PROPS = [
['alphaFade', 'boolean'],
Expand Down
3 changes: 2 additions & 1 deletion utils/rollup-build-target.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ function buildTarget({ moduleFormat, buildType, input = 'src/index.js', dir = 'b
name: 'pc',
preserveModules: !bundled,
file: bundled ? `${dir}/${OUT_PREFIX[buildType]}${isUMD ? '.js' : '.mjs'}` : undefined,
dir: !bundled ? `${dir}/${OUT_PREFIX[buildType]}` : undefined
dir: !bundled ? `${dir}/${OUT_PREFIX[buildType]}` : undefined,
entryFileNames: chunkInfo => `${chunkInfo.name.replace(/node_modules/g, 'modules')}.js`
},
plugins: [
resolve(),
Expand Down

0 comments on commit cf5254b

Please sign in to comment.