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

Build fixes for 1.70 #6360

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
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
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