Skip to content

Commit

Permalink
Custom bundler scripts are not working (T1269453) (#28711)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexslavr authored Jan 17, 2025
1 parent 8d00ab3 commit d45b84e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
27 changes: 26 additions & 1 deletion .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,34 @@ jobs:
run: pnpm run all:build

- name: Copy build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devextreme-npm-packages
path: |
artifacts/npm/*.tgz
retention-days: 1

custom_bundles:
runs-on: devextreme-shr2
needs: build

steps:
- name: Download npm packages
uses: actions/download-artifact@v4
with:
name: devextreme-npm-packages
path: npm

- name: Move devextreme package
run: mv ./npm/devextreme-2*.tgz ./devextreme.tgz

- name: Setup deps
run: |
npm init -y
npm i webpack terser-webpack-plugin
npm i ./devextreme.tgz
- name: Build bundle
run: |
npx devextreme-bundler-init custom-bundle
npx devextreme-bundler custom-bundle
2 changes: 2 additions & 0 deletions packages/devextreme/build/gulp/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ const sources = (src, dist, distGlob) => (() => merge(

pkg.name = 'devextreme';
pkg.version = ctx.version;

delete pkg.devDependencies;
delete pkg.publishConfig;
delete pkg.scripts;

file.contents = Buffer.from(JSON.stringify(pkg, null, 2));
callback(null, file);
Expand Down
7 changes: 5 additions & 2 deletions packages/devextreme/build/npm-bin/bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ const createConfig = function(outputFile, mode) {

config.resolve = {
alias: {
'devextreme': sourcesDir
'devextreme': sourcesDir,
'../../events/index': path.resolve(sourcesDir, 'cjs/events/index.js'),
'../../common/core/events/utils/index': path.resolve(sourcesDir, 'cjs/common/core/events.js')
},
mainFields: ['main']
};
Expand All @@ -43,7 +45,8 @@ webpack([

const jsonStats = stats.toJson();
if(jsonStats.errors.length) {
console.log('\'' + bundle + '\' bundles creation failed!\n\n' + jsonStats.errors.join('\n\n'));
const errorMessages = jsonStats.errors.map(({ message }) => message);
console.log('\'' + bundle + '\' bundles creation failed!\n\n' + errorMessages.join('\n\n'));
} else {
console.log('\'' + bundle + '\' bundles created!');
}
Expand Down
4 changes: 4 additions & 0 deletions packages/devextreme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@
"qunit-in-docker": "gulp qunit-in-docker --constel",
"tcd-update": "tcd-update"
},
"bin": {
"devextreme-bundler-init": "bin/bundler-init.js",
"devextreme-bundler": "bin/bundler.js"
},
"browserslist": [
"last 2 versions",
"ios > 9",
Expand Down

0 comments on commit d45b84e

Please sign in to comment.