Closed tobystokes closed 5 years ago
General use in bundled web project (e.g. Blogs)
import * as smg from 'smg-design-system'; smg.accordions()
Alt use in node.js (e.g. Collections)
const smg = require('smg-design-system'); smg.accordions()
<html> <script src="https://cdn/smg/module.min.js"></script> <script> smg.accordions(); </script> </html>
This (probably?) requires outputting a few different formats (bundle.js / bundle.es6.js ) into the dist folder used by npm.
Can't find an easy way to do this via browserify - switch to webpack?
Use cases:
ES2015 module import:
General use in bundled web project (e.g. Blogs)
CommonJS module require:
Alt use in node.js (e.g. Collections)
For simple/quick uses, without build process, use the library by loading it via a script tag:
This (probably?) requires outputting a few different formats (bundle.js / bundle.es6.js ) into the dist folder used by npm.
Can't find an easy way to do this via browserify - switch to webpack?