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

Custom bundler scripts are not working (T1269453) #28711

Open
wants to merge 6 commits into
base: 24_2
Choose a base branch
from
Open
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
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
6 changes: 6 additions & 0 deletions packages/devextreme/build/gulp/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,14 @@ const sources = (src, dist, distGlob) => (() => merge(

pkg.name = 'devextreme';
pkg.version = ctx.version;
pkg.bin = {
'devextreme-bundler-init': 'bin/bundler-init.js',
'devextreme-bundler': 'bin/bundler.js'
};

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
Loading