prestarocket-agence / classic-rocket

Classic Rocket is a rework of "classic theme". It has been built keeping in mind : performance, accessibility and SEO.
https://demoprestashop.prestarocket.com/
Other
230 stars 127 forks source link

Change path to Bootstrap JS resources ("dist" instead of "src") - BUG on Edge #165

Closed ggodin closed 4 years ago

ggodin commented 4 years ago

I installed the theme on a new Prestashop and there was JS errors on the front-office, but only on Edge navigator.

After investigating, I noticed that in the file /_dev/js/theme.js all the JS resources from Bootstrap were imported from the "/src" dir instead of the "/dist" dir. The JS files in the /src dir are raw JS that are not compliant with all browsers (i.e. Edge) ; the ones in the /dist are compiled and compliant.

The FIX

In the file /_dev/js/theme.js , I replaced the lines:

import 'bootstrap/js/src/util';
import 'bootstrap/js/src/alert';
import 'bootstrap/js/src/button';
import 'bootstrap/js/src/collapse';
import 'bootstrap/js/src/dropdown';
import 'bootstrap/js/src/modal';
import 'bootstrap/js/src/popover';
import 'bootstrap/js/src/tab';
import 'bootstrap/js/src/toast';
import 'bootstrap/js/src/tooltip';

by :

import 'bootstrap/js/dist/util';
import 'bootstrap/js/dist/alert';
import 'bootstrap/js/dist/button';
import 'bootstrap/js/dist/collapse';
import 'bootstrap/js/dist/dropdown';
import 'bootstrap/js/dist/modal';
import 'bootstrap/js/dist/popover';
import 'bootstrap/js/dist/tab';
import 'bootstrap/js/dist/toast';
import 'bootstrap/js/dist/tooltip';

Then I re-run the npm run build command on the /_dev dir and everything works fine, even on Edge.

prestarocket commented 4 years ago

do you use the last version ? i fix it in webpack/babel : https://github.com/prestarocket-agence/classic-rocket/commit/d469367c400e1795e6685273ff15c827fbbc96b0

ggodin commented 4 years ago

No, I am on v3.0.1. The website is already online.

If your fix is good, then it's OK.

prestarocket commented 4 years ago

ok , i close