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

Add scripts to run builds for specific platforms #902

Merged
merged 2 commits into from
Feb 25, 2022
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
20 changes: 16 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ module.exports = function (grunt) {
dirs: dirs,
pkgVersion: grunt.file.readJSON('package.json').version,
webpack: {
config: webpackConfig
all: Object.values(webpackConfig),
node: webpackConfig.node,
browser: [webpackConfig.browser, webpackConfig.browserMin]
}
};

Expand Down Expand Up @@ -110,7 +112,17 @@ module.exports = function (grunt) {

grunt.registerTask('build', [
'checkGitSubmodules',
'webpack'
'webpack:all'
]);

grunt.registerTask('build:node', [
'checkGitSubmodules',
'webpack:node'
]);

grunt.registerTask('build:browser', [
'checkGitSubmodules',
'webpack:browser'
]);

grunt.registerTask('check-closure-compiler', [
Expand All @@ -126,12 +138,12 @@ module.exports = function (grunt) {
grunt.registerTask('test', ['test:node']);
grunt.registerTask('test:node',
'Build the library and run the node test suite\nOptions\n --test [tests] e.g. --test test/rest/auth.js',
['build', 'mocha']
['build:node', 'mocha']
);

grunt.registerTask('test:webserver',
'Launch the Mocha test web server on http://localhost:3000/',
['build', 'checkGitSubmodules', 'mocha:webserver']
['build:browser', 'checkGitSubmodules', 'mocha:webserver']
);

grunt.registerTask('release:refresh-pkgVersion',
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
"test:webserver": "grunt test:webserver",
"test:playwright": "node spec/support/runPlaywrightTests.js",
"concat": "grunt concat",
"build": "grunt build",
"build": "grunt build:all",
"build:node": "grunt build:node",
"build:browser": "grunt build:browser",
"requirejs": "grunt requirejs",
"lint": "eslint nodejs/**/*.js common/**/*.js browser/lib/**/*.js",
"lint:fix": "eslint --fix nodejs/**/*.js common/**/*.js browser/lib/**/*.js",
Expand Down
24 changes: 12 additions & 12 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,15 +282,15 @@ const commonJsNoEncryptionConfig = {
},
};

module.exports = [
nodeConfig,
browserConfig,
browserMinConfig,
webworkerConfig,
nativeScriptConfig,
reactNativeConfig,
noEncryptionConfig,
noEncryptionMinConfig,
commonJsConfig,
commonJsNoEncryptionConfig,
];
module.exports = {
node: nodeConfig,
browser: browserConfig,
browserMin: browserMinConfig,
webworker: webworkerConfig,
nativeScript: nativeScriptConfig,
reactNative: reactNativeConfig,
noEncryption: noEncryptionConfig,
noEncryptionMin: noEncryptionMinConfig,
commonJs: commonJsConfig,
commonJsNoEncryption: commonJsNoEncryptionConfig,
};