search

Home  >  Q&A  >  body text

angular.js - 如何用gulp打包ionic应用,项目JS脚本是使用 require.js 来组织的

我的项目情况是这样的:

dev文件夹目录结构如下:

index.html文件内容如下:

main.js文件内容如下:

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

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

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

ringa_leeringa_lee2744 days ago533

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-05-15 17:05:41

    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.

    reply
    0
  • PHP中文网

    PHP中文网2017-05-15 17:05:41

    Use Yeoman and find a project generator! Follow the steps and you will understand after you figure it out!

    reply
    0
  • PHP中文网

    PHP中文网2017-05-15 17:05:41

    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

    reply
    0
  • Cancelreply