├── .gitignore ├── README.md ├── lib ├── ColorPlugin.js ├── CssPlugin.js ├── MotionGuidePlugin.js ├── RelativePlugin.js ├── RotationPlugin.js ├── SamplePlugin.js ├── create.js ├── easel.js ├── preload.js ├── sound.js └── tween.js ├── package-lock.json ├── package.json ├── src ├── ColorPlugin.js ├── CssPlugin.js ├── MotionGuidePlugin.js ├── RelativePlugin.js ├── RotationPlugin.js ├── SamplePlugin.js ├── create.js ├── easel.js ├── plugins │ ├── CSSPlugin.js │ ├── ColorPlugin.js │ ├── MotionGuidePlugin.js │ ├── RelativePlugin.js │ ├── RotationPlugin.js │ └── SamplePlugin.js ├── preload.js ├── sound.js └── tween.js └── webpack.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | *.log 4 | .sw* 5 | .idea 6 | .idea/* 7 | .vscode 8 | !.gitignore 9 | !.editorconfig 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # createjs-npm 2 | 3 | > createjs 的 cmd 标准版本,可以像 npm 包一样引入使用,同时也支持单个模块使用 4 | 5 | ## 安装 6 | 7 | ```bash 8 | tnpm install createjs-npm -S 9 | ``` 10 | 11 | ## 使用 12 | 13 | ```js 14 | // 引入后和官方 createjs 使用无任何区别 15 | // 引入全部模块 16 | import createjs from 'createjs-npm'; 17 | 18 | // 只引入 easeljs 19 | import createjs from 'createjs-npm/lib/easel'; 20 | 21 | // 只引入 preload 22 | import createjs from 'createjs-npm/lib/preload'; 23 | 24 | // 只引入 tween 25 | import createjs from 'createjs-npm/lib/tween'; 26 | 27 | // 只引入 sound 28 | import createjs from 'createjs-npm/lib/sound'; 29 | 30 | // 只引入某插件,如ColorPlugin 31 | import 'createjs-npm/lib/ColorPlugin'; 32 | ``` 33 | 34 | ## 包含 35 | 36 | ```json 37 | { 38 | "easeljs": "^1.0.2", // 用于 Sprites 、动画、向量和位图的绘制 39 | "preloadjs": "^1.0.1", // 网站资源预加载 40 | "soundjs": "^1.0.1", // 音频播放引擎 41 | "tweenjs": "^1.0.2", // 用于做动画效果 42 | "ColorPlugin": "^1.0.2", // 用于颜色渐变插件 43 | "CSSPlugin": "^1.0.2", // 插件 44 | "MotionGuidePlugin": "^1.0.2", // 插件 45 | "RelativePlugin": "^1.0.2", // 插件 46 | "RotationPlugin": "^1.0.2", // 插件 47 | "SamplePlugin": "^1.0.2" // 插件 48 | } 49 | ``` 50 | 51 | ## 为什么要弄一个 npm 版本的 createjs ? 52 | 53 | - 目前官方版本的 [createjs](https://createjs.com/) **不支持通过 npm 方式的使用**,导致在 ES6 开发中,需要在 html 中手动引入一个 `