结合gulp来编译js在撇号中? [英] Incorporating gulp to compile js in apostrophe?

查看:189
本文介绍了结合gulp来编译js在撇号中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人把咕嘟咕嘟咕咕for for for for assets assets assets???我想使用ES6,因为我使用的是一个前端框架,它将所有j很好地分割成单独的资源,并将其汇编成正常撇号构建过程的一个缩小文件部分(我是使用撇号资产来引用一个单独的根js文件,其中导入了其他所有内容)。 解决方案

好的问题。您需要使用Gulp将您的JavaScript构建为一个文件,然后再使用Apostrophe的资产管道将该文件推送到浏览器。

例如,您可能有一个 / src 目录位于您的项目的根目录中,该目录包含JavaScript文件。您可以将这些文件传输到您的撇号资产目录或其他一些名为撇号模块的子目录中。在 / lib / modules / 中。

然后,您可以像往常一样将编译的文件推送到浏览器: http://apostrophecms.org/docs/tutorials/getting-started/pushing-assets.html#configuring-java-脚本为浏览器


Has anyone rolled gulp into apostrophe for compiling assets? I'd like to use ES6, as I'm using a frontend framework that has all of the js nicely split up into separate assets, and have the compilation of that into one minified file part of the normal apostrophe build process (I'm using apostrophe-assets to reference a single root js file which imports everything else).

解决方案

Great question. You're going to want to build your JavaScript with Gulp into one file before pushing that file to the browser using Apostrophe's asset pipeline.

For example you might have a /src directory at the root of your project that has your JavaScript files. You can pipe these files into your apostrophe-assets directory or some other named directory that is a subclass of apostrophe-module in /lib/modules/.

You can then push your compiled file to the browser as usual: http://apostrophecms.org/docs/tutorials/getting-started/pushing-assets.html#configuring-java-script-for-the-browser

这篇关于结合gulp来编译js在撇号中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆