roja45 Posted August 16, 2017 Share Posted August 16, 2017 Is the core.js file a compressed version of all the files in the _core directory, i.e. can I just combine those files to get an uncompressed version, more developer friendly version so I can actually see what's going on, or is it complied and combined in a special way? Link to comment Share on other sites More sharing options...
fortuner Posted August 16, 2017 Share Posted August 16, 2017 Is the core.js file a compressed version of all the files in the _core directory, i.e. can I just combine those files to get an uncompressed version, more developer friendly version so I can actually see what's going on, or is it complied and combined in a special way? Where did you find _core directory??? I wanted to lay my hands on that code long time ago! Link to comment Share on other sites More sharing options...
roja45 Posted August 16, 2017 Author Share Posted August 16, 2017 The source code is on github,_core directory is there. Would be useful to have an uncompressed version when debug is enabled, lots of interesting stuff going on there. 1 Link to comment Share on other sites More sharing options...
fortuner Posted August 16, 2017 Share Posted August 16, 2017 (edited) The source code is on github,_core directory is there. Would be useful to have an uncompressed version when debug is enabled, lots of interesting stuff going on there. Thanks! Can you give me the link? And how do you think, is there something to be removed to shrink the core.js file size? It's ridiculously large as for me. PS: You can remove the js minification in webpack.config.js in _dev folder by playing with the code ( or just deleting it ) : config.plugins.push( new webpack.optimize.UglifyJsPlugin({ sourceMap: false, compress: { sequences: true, conditionals: true, booleans: true, if_return: true, join_vars: true, drop_console: true }, output: { comments: false }, minimize: true }) ); Here is the explanation how to use webpack in PS1.7.2.0 https://www.prestashop.com/forums/topic/612908-how-to-use-webpack-with-classic-theme/?do=findComment&comment=2591297 Edited August 16, 2017 by fortuner (see edit history) 1 Link to comment Share on other sites More sharing options...
roja45 Posted August 16, 2017 Author Share Posted August 16, 2017 https://github.com/PrestaShop/PrestaShop/tree/1.7.2.x You can download the zip. Thanks for the info, I'll check it out. No idea regarding core.js, only just starting with 1.7, finally getting around to updating my modules. I'm less concerned about making 1.7 installation more efficient for than having to relearn everything to get the modules to work. Link to comment Share on other sites More sharing options...
mantas393 Posted January 9, 2019 Share Posted January 9, 2019 Is it a good idea to change something in core.js or maybe there are ways to override specific core.js functions? Link to comment Share on other sites More sharing options...
roja45 Posted January 9, 2019 Author Share Posted January 9, 2019 (edited) no, you shouldn't change core.js, it's built using webpack. You can make additions in the custom.js, or change any of the core js files, and then rebuild the core js. Edited January 9, 2019 by roja45 correction (see edit history) Link to comment Share on other sites More sharing options...
mantas393 Posted January 9, 2019 Share Posted January 9, 2019 Thanks @roja45, and this core.js will not be overwritten with the next prestashop update, right? Link to comment Share on other sites More sharing options...
roja45 Posted January 9, 2019 Author Share Posted January 9, 2019 custom.js not theme.js I don't think there are any guarantees. If you're making changes to the default theme, and they make updates to the default theme, you'll likely lose those changes, but I assume changes made in the custom.js file will survive updates. Maybe you can use the new child theme feature, but I haven't used that myself, so can't comment on how it may work.. Link to comment Share on other sites More sharing options...
maestrobo Posted June 19, 2021 Share Posted June 19, 2021 it might help but with prestashop 1.7 i am quoting this post: https://github.com/PrestaShop/PrestaShop/issues/13562 Quote Hi, I guess you are referring to https://github.com/PrestaShop/PrestaShop/blob/develop/themes/core.js ? This is a bundled JS file, created by webpack. The developer version is splitted into several files, each relevant to one topic. You can find them in https://github.com/PrestaShop/PrestaShop/tree/develop/themes/_core/js https://github.com/PrestaShop/PrestaShop/tree/develop/themes/_core/js Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now