How to include a CDN to VueJS CLI without NPM or Webpack?

Unfortunately, no, you can’t add a <script> tag to a specific component via template. In your case you have some options: 1: Use NPM Propertly install the dependency using npm Pros: proper usage of NPM and Webpack; scoped definition; Cons: the script must be available as a NPM package. Note: when available this is the … Read more

Why am I getting “Unexpected token import” on one webpack project but not the other?

I had a similar issue where I was using async\await and Promises (both ES6 constructs) using the import keyword in the ts source files to import other ts modules. I could transpile with TypeScript using the default js target version (ES5) which produces transpile errors complaining about the async\await and Promise keywords but since I’m … Read more

Current file path in webpack

Yep there is one: __filename. But by default webpack doesn’t leak path information and you need to set a config flag to get real filename instead of a mock (“/index.js”). // /home/project/webpack.config.js module.exports = { context: __dirname, node: { __filename: true } } Than you can use __filename get the current filename relative to the … Read more

Cannot run webpack-dev-server inside docker

You are actualy listening on localhost only. To be reachable from outside replace the following line in your package.json file: “start”: “webpack-dev-server –inline –content-base .” by : “start”: “webpack-dev-server –host 0.0.0.0 –inline –content-base .” Related discussion : https://github.com/webpack/webpack-dev-server/issues/147

Getting “Error: `output.path` needs to be an absolute path or `/`”

As the error message says, you need to use absolute path. To get an absolute path for current directory, You can use __dirname to get the current directory and then append dist/js. So it would be something like, output: { path: __dirname + “/dist/js”, // or path: path.join(__dirname, “dist/js”), filename: “bundle.js” } Both will work … Read more

angular2-cli include custom fonts

For the people arriving here by searching: Install with npm: npm install roboto-fontface –save Add to styles in .angular-cli.json (apps[0].styles): “styles”: [ “styles.css”, “../node_modules/roboto-fontface/css/roboto/roboto-fontface.css” ], That’s all! Edit: since Angular 6 this file is called angular.json instead of angular-cli.json. Adding fonts still works the same way as before.

Why would we exclude node_modules when using babel-loader?

In short, transpiling is an expensive process and many projects have thousands (if not hundreds of thousands) of lines of code imported in that babel would need to run over. Your node_modules should already be runnable without transpiling as said already and there are simple ways to exclude your node_modules but transpile any code that … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)