I'm writing a lib with webpack with these settings: output: { path: path.join('build'), filename: 'my_lib.js', library: 'MyLib', libraryTarget: 'umd' }, MyLib: export default function() { co...
I'm not sure if I'm doing this properly. Please have a look at this simple Vue component Test.vue: <template> <div> Hi from {{name}} </div> </template> <script> let self; export default...
I want to create a frontend library. Therefore I want to use webpack. I especially like the css and image loader. However I can only require non-JS files if I am using webpack. Because I am building a library, I cannot garanty that the user of my lib...
I installed reactjs and react-dom like this with package.json "dependencies": { "bootstrap": "^v4.1.1", "popper.js": "^1.14.3", "react": "^v16.4.1", "react-dom": "^16.4....
I have found a few StackOverflow questions related to this but none that match nor fix my problem. I am writing a library in ES6 that is intended to be used in the browser and on the server. I have found a few HTTP request libraries that can be use...
I'm writing a library using handlebars templates and I want to use Webpack to bundle it. I'm using handlebars-loader so that I can require and precompile the templates. However I don't want handlebars (nor handlebars/runtime) to be inclu...
I'm creating my first AngularJS module intended for open source distribution. I'd like to package it in a way that's easy for others to consume. The UMD project provides a pattern for exporting JavaScript modules that are compatible with...
I tried this the last two days and I can't get it to work like expected: I want to build my own JavaScript library and register it under an already existing namespace ("OCA" - in this particular case). And as you might understand, I don...
I have a library that is basically an IIFE that sets a global variable, and clients are supposed to operate on said variable. So, in module.js, I have something like window.myModule = (function(){ ... return { foo: foo, bar:...
I read this post and i want use D3.js (v4+) using only import statement like this: import { selection } from '../node modules/d3/build/d3.js'; But, because code output is UMD (or read this) and can't import because some globals is no d...
©2020 All rights reserved.