search

Home  >  Q&A  >  body text

angular.js - How to use gulp to package ionic applications, the project JS script is organized using require.js

My project situation is as follows:

The directory structure of the dev folder is as follows:

The content of the index.html file is as follows:

The content of the main.js file is as follows:

The main content of gulp related file gulpfile.js is as follows:

But running the "bundle" task does not merge all js into main-bundle.js.

Although I have read the tutorials on gulp and requirejs, I still don’t know how to package them. Please give me some answers~~~

ringa_leeringa_lee2790 days ago572

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