Skip to content
Advertisement

Tag: webpack

Vue cli 3 display info from the package.json

In a vue cli 3 project I want to display a version number in the webpage. The version number lies in the package.json file. The only reference to this that I found is this link in the vue forum. However, I can’t get the proposed solution to work. Things I tried Use webpack.definePlugin as in the linked resource: vue.config.js Then

Babel not compiling vendors chuck

I migrated to Webpack 4 and set up everything according to the Docs, however, my vendors.js chunk is not getting compiled like the main.js chunk. I have placed the vendors into the optimization.splitChunks.cacheGroups object, as the docs suggested, but didnt find a way to make these “cacheGroups” get compiled with babel. My problem is that one of the libraries has

Storybook with absolute paths

In our app we use absolute paths for importing. As an example if we have a path which is relative to the src folder, we can just write import module from “components/myComponent”. The issue is that this is not working in storybook. After some digging it turns out you can take the default webpack config and extend it as needed

Babel not transpiling arrow functions (Webpack)

When running webpack, and babel, the resulting bundle.js still contains arrow functions. This gives me a Syntax Error when running in Internet Explorer 10. I would like babel to replace the arrow functions with normal functions that IE can run. My package.json has the following devDependencies: My webpack.config.js looks like this: My .babelrc looks like this: To transpile, I run

How to remove folder with npm before build

I’ve got a scripts “build”: “rimraf dist webpack –progress –config webpack/prod.js”, But actually,it removed not dist but all file inside webpack folder. But I need delete only dist Answer Npm scripts are basically the same as running the commands directly in bash. In your case, you are running rimraf dist webpack which means webpack is an argument for rimraf. To

How to import ipcRenderer in react?

I’ve tried to import ipcRenderer in react app but I get this error message : require is not defined Answer You need to use Otherwise it will try to import it from Webpack or whatever module bundler you use. You can checkout this thread for a better explanation: https://github.com/electron/electron/issues/7300

Advertisement