I’m creating a Maven archetype that includes a javascript file. I would like to use the ${package} and ${artifactId} template variables inside my javascript file. Is this possible? When I then generate a project from the archetype, the javascript file still includes the ${package} rather than the value of package. Here is the relevant part of my archetype-metadata.xml Answer You
Tag: webpack
How to set env in package.json which is used within .bablerc
I am trying to run Jest tests as part of a script before I then run webpack, like this. Jest only works with compiled code, so I had set my .babelrc to the following, which worked, however then it transpiled all my code in webpack which I didn’t want, in development mode I want to leave the JavaScript un-transpiled so
Alternatives to deprecated Webpack’s i18n plugin and loader
I’m working on a TypeScript project that needs to load translations from .json files, the intention is to have a single language file per country. Example: en.json, es.json. Then I should to be able to use the translations inside .ts files with some function like __(‘red’) or as other extensions offer. Then the final compiled .js files should contain all
Ignore return outside of function with babel 7
I recently updated to babel 7 and webpack 4 and am receiving this error when running our gulp build task: This is caused by the return outside of a function in browser-syncs dev-ip dependency. Is there a way to configure my .babelrc file to ignore this? I’ve tried the following: Installing only production dependencies, but because browser sync is imported
Babel and Webpack are throwing “Can’t resolve ‘regenerator-runtime/runtime'”
I’m working on a browser-based project that needs to be IE11-compatible (sigh). Webpack is choking on async/await. Here is my console’s output: I’ve looked at many SO questions similar to mine, without luck. Many recommend using @babel/polyfill which I am avoiding since it has been deprecated. What is causing this issue? I expect it could be fixed by manually importing
Unable to require() a variable path from props in VueJS
I am sending data – a URL to a local image file, from parent to child, and when I load it in child component’s it shows an error, but if I directly load it, it works. Code: In parent.vue component’s data: In child.vue component’s mounted() And console.log(this.item.src) gives exactly the same string, so the child is actually getting the data
Vue CLI – combine build output to a single html file
I have a vue project created with vue-cli. The normal output when running yarn build is a dist folder with an index.html and a js and css sub-directory with the corresponding .js and .css files. I want the build output to be a single html file that contains the js and css. I added a vue.config.js file in the root
Control webpack verbosity when programmatically starting vue-cli-service serve
I’m trying to run vue-cli-service serve from inside a Node.js application like this: And it works. But when I do it in production mode (change service.init(“development”) to service.init(“production”)), I don’t see the webpack “building” progress anymore. Hence my question: how to start a Vue server in production mode, but keep webpack progress printed to the console? Answer Progress is reported
plugin is not working in Webpack with React JS
I am creating a React JS app. I have installed terser-webpack-plugin to both try to compress my code as well as remove console.log() statements. However, it does not seem to be working. I have installed the terser-webpack-plugin as follows: My webpack.config.js file looks like this: However, when I run npm run build or npm run dev it does not seem
Webpack dev server and WebSockets
Three quick questions: 1) Knowing full well the benefits of Socket.io, I still wanna know if it is possible to run a single webpack-dev-server that can server both http and ws. Everything online is oriented to using Socket.io and running dual servers for http / ws. 2) If indeed I must use Socket.io, how does local development (http server and