angular.js - 如何用gulp打包ionic应用,项目JS脚本是使用 require.js 来组织的
ringa_lee
ringa_lee 2017-05-15 17:03:41
0
3
535

我的项目情况是这样的:

dev文件夹目录结构如下:

index.html文件内容如下:

main.js文件内容如下:

gulp主要相关的文件gulpfile.js内容如下:

可是运行“bundle”task并没有把所有的js合并到main-bundle.js中。

虽然看了gulp和requirejs教程,还是不懂如何打包他们,求好心的大神解答~~~

ringa_lee
ringa_lee

ringa_lee

reply all(3)
Ty80

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:

  1. concat

  2. 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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template