Skip to content
Advertisement

Tag: webpack

Multiple HtmlWebpackPlugins with webpack DevServer

You can use multiple HtmlWebpackPlugin plugins to create more than one HTML file in production, but only one of the HTML files will be used by the DevServer. Is there any way to use all the HtmlWebpackPlugin plugins in development as well? Answer historyApiFallback can be given manual rewrites to control in a more fine-grained manner what the DevServer should

React Module parse failed: Unexpected token (1:48)

Can someone help me? I just create react app then I start it immediately. Then I got an error something like this. I don’t know much about webpack. CMD I just type npx create-react-app ./ in the directory then npm start then this error happened. I have tried to make 3 react app and same thing happened and i never

Natively import ES module dependencies from npm without bundling/transpiling first-party source

Background I’m trying to create a “buildless” JavaScript app, one where I don’t need a watch task running to transpile JSX, re-bundle code, etc every time I save any source file. It works fine with just first-party code, but I’m stuck when I try to import dependencies from npm. Goal I want to achieve this kind of workflow: npm install

nuxtjs – setting background-url to image from assets doesn’t work

after lots of research I haven’t found a solution which explains why this is happening. When trying to set the background-image in my div dynamically it doesn’t work and I am getting an 404 error. http://localhost:3000/~assets/images/postPreview.jpg 404 (Not Found) I am passing it like this (thumbnail): ~assets/images/postPreview.jpg and get the above error. If i pass it like this then it

Webpack can’t resolve @import of scss/css

I have a main Stylesheet style.scss, which I imported in my main JavaScript file script.js: This works great, and I could build my website that way in dev mode. Now I wanted to try and use separate Stylesheet and import them in my main stylesheet with the @import rule, like so: But now I get this error message: And I

Uncaught ReferenceError: regeneratorRuntime is not defined in react 17, webpack 5 while making api calls through actions

Having this error Uncaught ReferenceError: regeneratorRuntime is not defined when trying to make a api call using superagent. Currently i am using react 17, webpack 5 along with css modules and all latest packages. package.json babel.config.js webpack.config.js Answer For Babel 7, install these two dependencies: And, in .babelrc, add:

Optimizing React App’s Size In Production with Amcharts

I’m using amcharts (amcharts4) with React app(generated using cra). I was able to successfully exclude few dependencies(cpexcel, canvg, pdfmake) using webpack Externals in webpack.config file (node_modules/react-scripts/config/webpack.config.js) like this: I also want to exclude the xlsx dependency, but it throws error while building with this configuration: Error is: I’m not using any csv feature of amcharts. Is there any other possible

Advertisement