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

issue/2824 Replaced requirejs with rollup for module bundler #2827

Closed
wants to merge 15 commits into from
Closed
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: 0 additions & 27 deletions config.js

This file was deleted.

61 changes: 0 additions & 61 deletions grunt/config/babel.js

This file was deleted.

3 changes: 2 additions & 1 deletion grunt/config/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ module.exports = {
},
output: {
src: [
'<%= outputdir %>'
'<%= outputdir %>/*',
'!<%= outputdir %>.cache'
]
},
temp: {
Expand Down
67 changes: 56 additions & 11 deletions grunt/config/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module.exports = function(grunt, options) {
options: {
name: 'core/js/app',
baseUrl: '<%= sourcedir %>',
mainConfigFile: './config.js',
out: '<%= tempdir %>adapt.min.js',
out: '<%= outputdir %>adapt/js/adapt.min.js',
cachePath: '<%= outputdir %>.cache',
// fetch these bower plugins an add them as dependencies to the app.js
plugins: [
'<%= sourcedir %>components/*/bower.json',
Expand All @@ -18,12 +18,33 @@ module.exports = function(grunt, options) {
pluginsFilter: function(filepath) {
return grunt.config('helpers').includedFilter(filepath);
},
generateSourceMaps: true,
sourceMaps: {
baseUrl: '../../'
external: {
jquery: 'empty:',
underscore: 'empty:',
backbone: 'empty:',
modernizr: 'empty:',
handlebars: 'empty:',
velocity: 'empty:',
imageReady: 'empty:',
inview: 'empty:',
a11y: 'empty:',
scrollTo: 'empty:',
libraries: 'empty:',
bowser: 'empty:',
'core/js/libraries/bowser': 'empty:',
'coreJS/libraries/bowser': 'empty:'
},
preserveLicenseComments: false,
optimize: 'none'
map: {
coreJS: 'core/js',
coreViews: 'core/js/views',
coreModels: 'core/js/models',
coreCollections: 'core/js/collections',
coreHelpers: 'core/js/helpers',
// This library from the media component has a circular reference to core/js/adapt, it should be loaded after Adapt
// It needs to be moved from the libraries folder to the js folder
'libraries/mediaelement-fullscreen-hook': '../libraries/mediaelement-fullscreen-hook'
},
generateSourceMaps: true
},
// newer configuration
files: {
Expand All @@ -36,8 +57,8 @@ module.exports = function(grunt, options) {
options: {
name: 'core/js/app',
baseUrl: '<%= sourcedir %>',
mainConfigFile: './config.js',
out: '<%= tempdir %>adapt.min.js',
out: '<%= outputdir %>adapt/js/adapt.min.js',
cachePath: '<%= outputdir %>.cache',
// fetch these bower plugins an add them as dependencies to the app.js
plugins: [
'<%= sourcedir %>components/*/bower.json',
Expand All @@ -50,8 +71,32 @@ module.exports = function(grunt, options) {
pluginsFilter: function(filepath) {
return grunt.config('helpers').includedFilter(filepath);
},
preserveLicenseComments: false,
optimize: 'none'
external: {
jquery: 'empty:',
underscore: 'empty:',
backbone: 'empty:',
modernizr: 'empty:',
handlebars: 'empty:',
velocity: 'empty:',
imageReady: 'empty:',
inview: 'empty:',
a11y: 'empty:',
scrollTo: 'empty:',
libraries: 'empty:',
bowser: 'empty:',
'core/js/libraries/bowser': 'empty:',
'coreJS/libraries/bowser': 'empty:'
},
map: {
coreJS: 'core/js',
coreViews: 'core/js/views',
coreModels: 'core/js/models',
coreCollections: 'core/js/collections',
coreHelpers: 'core/js/helpers',
// This library from the media component has a circular reference to core/js/adapt, it should be loaded after Adapt
// It needs to be moved from the libraries folder to the js folder
'libraries/mediaelement-fullscreen-hook': '../libraries/mediaelement-fullscreen-hook'
}
}
}
};
Expand Down
5 changes: 4 additions & 1 deletion grunt/config/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ module.exports = {
},
js: {
files: ['<%= sourcedir %>**/*.js'],
tasks: ['javascript:dev', 'babel:dev', 'clean:temp']
options: {
spawn: false
},
tasks: ['javascript:dev', 'clean:temp']
},
componentsAssets: {
files: ['<%= sourcedir %>components/**/assets/**'],
Expand Down
1 change: 0 additions & 1 deletion grunt/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module.exports = function(grunt) {
'handlebars',
'tracking-insert',
'javascript:compile',
'babel:compile',
'clean:dist',
'less:compile',
'replace',
Expand Down
1 change: 0 additions & 1 deletion grunt/tasks/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = function(grunt) {
'handlebars',
'tracking-insert',
'javascript:dev',
'babel:dev',
'less:dev',
'replace',
'scripts:adaptpostbuild',
Expand Down
1 change: 0 additions & 1 deletion grunt/tasks/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = function(grunt) {
'newer:handlebars:compile',
'tracking-insert',
'newer:javascript:dev',
'babel:dev',
'newer:less:dev',
'replace',
'scripts:adaptpostbuild',
Expand Down
Loading