webpack-4

How to fix Uncaught DOMException: Failed to execute 'pushState' on 'History'

有些话、适合烂在心里 提交于 2021-01-26 08:05:10
问题 I have this little app that works fine in development mode with webpack-dev-server, but when I use the bundled files from the dist folder generated by the production mode, all I get in the browser is this error: Uncaught DOMException: Failed to execute 'pushState' on 'History': A history state object with URL 'file:///C:/' cannot be created in a document with origin 'null' and URL 'file:///C:/Users/cristi/work/react_test_ground/dist/index.html'. How can I solve this pushState problem?

How to set mode to development or production in the config file?

烂漫一生 提交于 2021-01-21 12:14:29
问题 We are migrating to webpack 4. We do have dev / prod config files already. We started getting this warning message: WARNING in configuration The 'mode' option has not been set. Set 'mode' option to 'development' or 'production' to enable defaults for this environment. We can get around this by passing --mode production in the cmdline like below: npm run webpack --mode development ... As is mentioned on the webpack documentation, blog and everywhere else on the internet. How can we set the

How to set mode to development or production in the config file?

血红的双手。 提交于 2021-01-21 12:14:08
问题 We are migrating to webpack 4. We do have dev / prod config files already. We started getting this warning message: WARNING in configuration The 'mode' option has not been set. Set 'mode' option to 'development' or 'production' to enable defaults for this environment. We can get around this by passing --mode production in the cmdline like below: npm run webpack --mode development ... As is mentioned on the webpack documentation, blog and everywhere else on the internet. How can we set the

Generate ServiceWorker using webpack 4.41 and workbox 6

痴心易碎 提交于 2020-12-15 00:44:37
问题 I am using webpack v4.41 and workbox v6 to create my service-worker.js . I am having trouble regitering the service worker in my dev environment. I have set devtools.serviceWorkers.testing.enabled to true I have followed the instructions for using bundlers with workbox, read the documentation for injectManifest and adding the Workbox webpack plugin. After building using webpack (generating serviceWorker.js) Firefox reports error: Service worker error TypeError: ServiceWorker script at http:/

webpack 4 gives background: url([object Module]) as bg image

霸气de小男生 提交于 2020-12-08 06:07:27
问题 I'm having issues with setting up web-pack 4 and svg-sprite-loader to render svg icons as background images. I was following these instructions from official docs for svg-sprite-loader (https://github.com/kisenka/svg-sprite-loader/tree/master/examples/extract-mode). I have successfully managed to create sprite.svg file in my dist folder and use it as reference for my use tags inside of html. However, i was also trying to use svg icons from my src/images/icons folder for a background image

webpack 4 gives background: url([object Module]) as bg image

早过忘川 提交于 2020-12-08 06:05:08
问题 I'm having issues with setting up web-pack 4 and svg-sprite-loader to render svg icons as background images. I was following these instructions from official docs for svg-sprite-loader (https://github.com/kisenka/svg-sprite-loader/tree/master/examples/extract-mode). I have successfully managed to create sprite.svg file in my dist folder and use it as reference for my use tags inside of html. However, i was also trying to use svg icons from my src/images/icons folder for a background image

Webpack 4 build with Angular 7 gives problem with the sass-loader when trying to access to node_modules

主宰稳场 提交于 2020-12-04 08:57:19
问题 I was working on a upgrade from Angular v4 to v7. There are some breaking changes due to the .angular-cli.json to angular.json and their structure. And then also upgrading the versions of angular and webpack has its impact. In Angular 4 it has worked fine with the custom webpack builder but upgrading to v7 has its complications. It is also worth mentioning that trying the build without any @imports in the scss on the node_modules that I use does work as expected too. So I see that the issue

Webpack 4 build with Angular 7 gives problem with the sass-loader when trying to access to node_modules

折月煮酒 提交于 2020-12-04 08:56:30
问题 I was working on a upgrade from Angular v4 to v7. There are some breaking changes due to the .angular-cli.json to angular.json and their structure. And then also upgrading the versions of angular and webpack has its impact. In Angular 4 it has worked fine with the custom webpack builder but upgrading to v7 has its complications. It is also worth mentioning that trying the build without any @imports in the scss on the node_modules that I use does work as expected too. So I see that the issue