Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[小白]请问如何用打包? #14

Open
paina-ma opened this issue Dec 7, 2017 · 4 comments
Open

[小白]请问如何用打包? #14

paina-ma opened this issue Dec 7, 2017 · 4 comments
Labels

Comments

@paina-ma
Copy link

paina-ma commented Dec 7, 2017

No description provided.

@proYang
Copy link
Owner

proYang commented Dec 7, 2017

你的意思是怎么用outils.min.js这个打包好的文件吗?

@proYang proYang added the 疑问 label Dec 7, 2017
@paina-ma
Copy link
Author

paina-ma commented Dec 8, 2017

感谢作者回复!
我大概明白了,如下引入方式是node的
// 只引入部分方法('outils/<方法名>') const getOS = require('outils/getOS') const OS = getOS()
我想用require.js 引入的话 就需要把模块改为require的规范,在使用r.js打包成一个js文件。请问是这样的吗?

@proYang
Copy link
Owner

proYang commented Dec 8, 2017

对,如果是RequireJS,可以把outils.min.js放入RequireJSbaseUrl目录下,然后使用。

define(function (require) {
    var outils = require('outils.min')
    console.log(outils.getOS())
});

@YZlingyu
Copy link

楼主大大打包是用的webpack吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants