angular.js - How to use gulp to package ionic applications, the project JS script is organized using require.js
ringa_lee
ringa_lee 2017-05-15 17:03:41
0
3
568

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_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