我的项目情况是这样的:
dev文件夹目录结构如下:
index.html文件内容如下:
main.js文件内容如下:
gulp主要相关的文件gulpfile.js内容如下:
可是运行“bundle”task并没有把所有的js合并到main-bundle.js中。
虽然看了gulp和requirejs教程,还是不懂如何打包他们,求好心的大神解答~~~
ringa_lee
Library files can be imported directly using <script src=""> in index.html, but you need to modify the configuration of the copy task of gulpfile to copy the library files to the release directory.
Use Yeoman and find a project generator! Follow the steps and you will understand after you figure it out!
There is a gulp plug-in amd-optimize that can be used to package AMD style files, and other plug-ins that will be used:
amd-optimize
concat
uglify
The above can be found at npmjs.com
---Additional content
I found an article specifically about front-end | gulp packaging require.js module dependencies
Library files can be imported directly using <script src=""> in index.html, but you need to modify the configuration of the copy task of gulpfile to copy the library files to the release directory.
Use Yeoman and find a project generator! Follow the steps and you will understand after you figure it out!
There is a gulp plug-in
amd-optimize
that can be used to package AMD style files, and other plug-ins that will be used:concat
uglify
The above can be found at npmjs.com
---Additional content
I found an article specifically about front-end | gulp packaging require.js module dependencies