Languages | |
Programming | |
Tech | |
splittydev / evee.js Goto Github PK
View Code? Open in Web Editor NEWThe lightweight es6 event library.
License: MIT License
The lightweight es6 event library.
License: MIT License
Hello!
Does 'use strict';
is really necessary?
Here's the warning I'm receiving for a create-react-app
project:
./src/smalldots/~/evee/dist/evee.js
/Users/hnordt/workspace/genesis/src/smalldots/node_modules/evee/dist/evee.js
1:1 warning 'use strict' is unnecessary inside of modules strict
โ 1 problem (0 errors, 1 warning)
The suggested import/require doesn't work as you expect.
echo "require('evee').Evee;" > index.js
browserify index.js
-> http://pastebin.com/2gdaAVmR
browserify's output contains both the ES6 and ES5 versions, so Evee 2 completely fails on non-ES6 browsers currently.
To do what you want, you need two files and not a joint entry point.
I'd suggest this configuration:
lib/evee.js
to es6.js
in prepublish{
"main": "dist/evee.js"
}
This way you can import the two versions separately:
var Evee = require('evee'); //es5
var Evee = require('evee/es6'); //es6
import Evee from 'evee/es6'; //es6 + modules
Currently, lib/evee.js
is loaded by the index.js
.
Update the index.js
to ship dist/evee.js
.
This is now easily possible, thanks to @Hypercubed (see #1).
I have just installed evee ^2.1.0
version.
The project description say:
The evee/es6 export is the ES6 version of evee, which is generally faster.
I'm trying to import using es6: import Evee from 'evee/es6'
. But the module doesn't seem to exist. Getting the error Module not found: 'evee/es6'
.
It's weird because it's fairly simple. Am I missing something?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.