You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.
// Import a couple modules for testing.import{sayHelloTo}from'./modules/mod1';importaddArrayfrom'./modules/mod2';importdebugfrom'debug';constlog=debug('app:log');debug.enable('*');log('Loging Start!!! Great!!!');debug.disable();// Run some functions from our imported modules.constresult1=sayHelloTo('Jason');constresult2=addArray([1,2,3,4]);// Print the results on the page.constprintTarget=document.getElementsByClassName('debug__output')[0];printTarget.innerText=`sayHelloTo('Jason') => ${result1}\n\n`;printTarget.innerText+=`addArray([1, 2, 3, 4]) => ${result2}`;
package.json
{"name": "learn-rollup","version": "0.0.0","description": "This is an example project to accompany a tutorial on using Rollup.","main": "build/js/main.min.js","scripts": {"test": "echo \"Error: no test specified\" && exit 1"},"repository": {"type": "git","url": "git+ssh://git@github.com/jlengstorf/learn-rollup.git"},"author": "Jason Lengstorf <jason@lengstorf.com> (@jlengstorf)","license": "ISC","bugs": {"url": "https://github.com/jlengstorf/learn-rollup/issues"},"homepage": "https://github.com/jlengstorf/learn-rollup#readme","devDependencies": {"babel-core": "^6.26.0","babel-preset-env": "^1.6.0","babel-preset-es2015-rollup": "^3.0.0","rollup": "^0.49.0","rollup-plugin-babel": "^3.0.2","rollup-plugin-commonjs": "^8.2.0","rollup-plugin-eslint": "^4.0.0","rollup-plugin-node-builtins": "^2.1.2","rollup-plugin-node-resolve": "^3.0.0","rollup-plugin-replace": "^1.1.1"},"dependencies": {"debug": "^3.0.1"}}
Such is my output:
PS D:\program\rollup_playground\learn-rollup-step-0> ./node_modules/.bin/rollup -c
(!) Some options have been renamed
https://gist.github.com/Rich-Harris/d472c50732dab03efeb37472b08a3f32
options.entry is now options.input
options.sourceMap is now options.sourcemap
options.dest is now options.output.file
options.format is now options.output.format
./src/scripts/main.js → ./build/js/main.min.js...
(!) Missing global variable name
Use options.globals to specify browser global variable names corresponding to external modules
debug (guessing 'debug')
created ./build/js/main.min.js in 631ms
and open in blowser(Chrome), console's output is:
main.js:21 Uncaught ReferenceError: debug is not defined
at main.js:21
(anonymous) @ main.js:21
How can I solve it?
The text was updated successfully, but these errors were encountered:
I'm watching the video How to Set Up Smaller, More Efficient JavaScript Bundling Using Rollup at 26:54 / 38:50 . Such is my files:
rollup.config.js:
main.js
package.json
Such is my output:
and open in blowser(Chrome), console's output is:
How can I solve it?
The text was updated successfully, but these errors were encountered: