pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    <bdo id='LTXpa'></bdo><ul id='LTXpa'></ul>
  • <i id='LTXpa'><tr id='LTXpa'><dt id='LTXpa'><q id='LTXpa'><span id='LTXpa'><b id='LTXpa'><form id='LTXpa'><ins id='LTXpa'></ins><ul id='LTXpa'></ul><sub id='LTXpa'></sub></form><legend id='LTXpa'></legend><bdo id='LTXpa'><pre id='LTXpa'><center id='LTXpa'></center></pre></bdo></b><th id='LTXpa'></th></span></q></dt></tr></i><div class="cmsyg02" id='LTXpa'><tfoot id='LTXpa'></tfoot><dl id='LTXpa'><fieldset id='LTXpa'></fieldset></dl></div>

    <small id='LTXpa'></small><noframes id='LTXpa'>

        <legend id='LTXpa'><style id='LTXpa'><dir id='LTXpa'><q id='LTXpa'></q></dir></style></legend>

        <tfoot id='LTXpa'></tfoot>

        如何使用 gulp webpack-stream 生成正確的命名文件?

        How to use gulp webpack-stream to generate a proper named file?(如何使用 gulp webpack-stream 生成正確的命名文件?)

          <small id='hQJx9'></small><noframes id='hQJx9'>

            <tbody id='hQJx9'></tbody>
        • <tfoot id='hQJx9'></tfoot>
            <bdo id='hQJx9'></bdo><ul id='hQJx9'></ul>
              <legend id='hQJx9'><style id='hQJx9'><dir id='hQJx9'><q id='hQJx9'></q></dir></style></legend>
              <i id='hQJx9'><tr id='hQJx9'><dt id='hQJx9'><q id='hQJx9'><span id='hQJx9'><b id='hQJx9'><form id='hQJx9'><ins id='hQJx9'></ins><ul id='hQJx9'></ul><sub id='hQJx9'></sub></form><legend id='hQJx9'></legend><bdo id='hQJx9'><pre id='hQJx9'><center id='hQJx9'></center></pre></bdo></b><th id='hQJx9'></th></span></q></dt></tr></i><div class="0y2gw22" id='hQJx9'><tfoot id='hQJx9'></tfoot><dl id='hQJx9'><fieldset id='hQJx9'></fieldset></dl></div>

                  本文介紹了如何使用 gulp webpack-stream 生成正確的命名文件?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時(shí)送ChatGPT賬號..

                  目前我們使用

                  我不能使用 c2212af8f732662acc64.js 我需要將其命名為 bundle.js 或其他正常名稱.

                  我們的 Webpack 配置:

                  var webpack = require('webpack');var PROD = JSON.parse(process.env.PROD_DEV || '0');//http://stackoverflow.com/questions/25956937/how-to-build-minified-and-uncompressed-bundle-with-webpack模塊.exports = {條目:./entry.js",開發(fā)工具:源地圖",輸出: {devtoolLineToLine:真,sourceMapFilename: "app/assets/js/bundle.js.map",路徑信息:真,路徑:__dirname,文件名:產(chǎn)品?app/assets/js/bundle.min.js":app/assets/js/bundle.js"},模塊: {裝載機(jī):[{測試:/.css$/,加載器:style!css"}]},插件:產(chǎn)品?[新的 webpack.optimize.UglifyJsPlugin({minimize: true})]:[]};

                  解決方案

                  啊,我繼續(xù)閱讀 并想通了:

                  gulp.task('webpack', function() {返回 gulp.src('entry.js').pipe(webpack( 需要('./webpack.config.js') )).pipe(gulp.dest('app/assets/js'));});

                  ^ 在這里我可以傳入我的實(shí)際 webpack.config,它會使用我已經(jīng)在那里設(shè)置的路徑.在我的情況下,我剛剛刪除了 app/assets/js 因?yàn)槲椰F(xiàn)在 gulp 中有該路徑.

                  但仍然沒有世俗的想法,為什么在我創(chuàng)建的第一個(gè)任務(wù)中,它會生成隨機(jī)哈希文件名?

                  Currently we're using Webpack for our Module loader, and Gulp for everything else (sass -> css, and the dev/production build process)

                  I want to wrap the webpack stuff into gulp, so all I have to do is type gulp and it starts, watches and runs webpack and the rest of what our gulp is setup to do.

                  So I found webpack-stream and implemented it.

                  gulp.task('webpack', function() {
                      return gulp.src('entry.js')
                          .pipe(webpack({
                              watch: true,
                              module: {
                                  loaders: [
                                      { test: /.css$/, loader: 'style!css' },
                                  ],
                              },
                          }))
                          .pipe(gulp.dest('dist/bundle.js'));
                  });
                  

                  The problem is that it generates a random character name for the .js file, how are we suppose to use that in our app?

                  From the github repo:

                  The above will compile src/entry.js into assets with webpack into dist/ with the output filename of [hash].js (webpack generated hash of the build).

                  How do you rename these files? Also the new gulp task generates a new file everytime I save an edit:

                  I can't use c2212af8f732662acc64.js I need it to be named bundle.js or something else normal.

                  Our Webpack config:

                  var webpack = require('webpack');
                  var PROD = JSON.parse(process.env.PROD_DEV || '0');
                  // http://stackoverflow.com/questions/25956937/how-to-build-minified-and-uncompressed-bundle-with-webpack
                  
                  module.exports = {
                      entry: "./entry.js",
                      devtool: "source-map",
                      output: {
                          devtoolLineToLine: true,
                          sourceMapFilename: "app/assets/js/bundle.js.map",
                          pathinfo: true,
                          path: __dirname,
                          filename: PROD ? "app/assets/js/bundle.min.js" : "app/assets/js/bundle.js"
                      },
                      module: {
                          loaders: [
                              { test: /.css$/, loader: "style!css" }
                          ]
                      },
                      plugins: PROD ? [
                          new webpack.optimize.UglifyJsPlugin({minimize: true})
                      ] : []
                  };
                  

                  解決方案

                  Ah I read on a bit further and figured it out:

                  gulp.task('webpack', function() {
                      return gulp.src('entry.js')
                      .pipe(webpack( require('./webpack.config.js') ))
                      .pipe(gulp.dest('app/assets/js'));
                  });
                  

                  ^ here I can just pass in my actual webpack.config and it will use the paths I have already set in there. In my case I just removed app/assets/js since I have that path in now gulp instead.

                  Still no earthly idea though, why with the first task I created, it generates random hash filenames?

                  這篇關(guān)于如何使用 gulp webpack-stream 生成正確的命名文件?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運(yùn)算符上的意外令牌)
                  Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標(biāo)志傳遞給 Gulp 以使其以不同的方式運(yùn)行任務(wù)?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個(gè)接一個(gè)地依次運(yùn)行 Gulp 任務(wù))
                  Stylesheet not loaded because of MIME-type(由于 MIME 類型而未加載樣式表)
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時(shí) Visual Studio 2015 崩潰)
                  • <tfoot id='Jc9iI'></tfoot>
                      <tbody id='Jc9iI'></tbody>

                      1. <i id='Jc9iI'><tr id='Jc9iI'><dt id='Jc9iI'><q id='Jc9iI'><span id='Jc9iI'><b id='Jc9iI'><form id='Jc9iI'><ins id='Jc9iI'></ins><ul id='Jc9iI'></ul><sub id='Jc9iI'></sub></form><legend id='Jc9iI'></legend><bdo id='Jc9iI'><pre id='Jc9iI'><center id='Jc9iI'></center></pre></bdo></b><th id='Jc9iI'></th></span></q></dt></tr></i><div class="gsu2iye" id='Jc9iI'><tfoot id='Jc9iI'></tfoot><dl id='Jc9iI'><fieldset id='Jc9iI'></fieldset></dl></div>
                        • <small id='Jc9iI'></small><noframes id='Jc9iI'>

                          <legend id='Jc9iI'><style id='Jc9iI'><dir id='Jc9iI'><q id='Jc9iI'></q></dir></style></legend>
                            <bdo id='Jc9iI'></bdo><ul id='Jc9iI'></ul>

                            主站蜘蛛池模板: NM-02立式吸污机_ZHCS-02软轴刷_二合一吸刷软轴刷-厦门地坤科技有限公司 | 产业规划_产业园区规划-产业投资选址及规划招商托管一体化服务商-中机院产业园区规划网 | 红外光谱仪维修_二手红外光谱仪_红外压片机_红外附件-天津博精仪器 | LHH药品稳定性试验箱-BPS系列恒温恒湿箱-意大利超低温冰箱-上海一恒科学仪器有限公司 | 医用酒精_84消毒液_碘伏消毒液等医用消毒液-漓峰消毒官网 | 温州食堂承包 - 温州市尚膳餐饮管理有限公司 | 百度网站优化,关键词排名,SEO优化-搜索引擎营销推广 | 沧州友城管业有限公司-内外涂塑钢管-大口径螺旋钢管-涂塑螺旋管-保温钢管生产厂家 | 便携式XPDM露点仪-在线式防爆露点仪-增强型烟气分析仪-约克仪器 冰雕-冰雪世界-大型冰雕展制作公司-赛北冰雕官网 | 氟塑料磁力泵-不锈钢离心泵-耐腐蚀化工泵厂家「皖金泵阀」 | 耐高温风管_耐高温软管_食品级软管_吸尘管_钢丝软管_卫生级软管_塑料波纹管-东莞市鑫翔宇软管有限公司 | 纯水设备_苏州皙全超纯水设备水处理设备生产厂家 | 户外健身路径_小区健身器材_室外健身器材厂家_价格-浩然体育 | 电动百叶窗,开窗器,电动遮阳百叶,电动开窗机生产厂家-徐州鑫友工控科技发展有限公司 | 玻璃钢型材_拉挤模具_玻璃钢拉挤设备——滑县康百思 | 电动垃圾车,垃圾清运车-江苏速利达机车有限公司 | 成都LED显示屏丨室内户外全彩led屏厂家方案报价_四川诺显科技 | 防勒索软件_数据防泄密_Trellix(原McAfee)核心代理商_Trellix(原Fireeye)售后-广州文智信息科技有限公司 | 蓝米云-专注于高性价比香港/美国VPS云服务器及海外公益型免费虚拟主机 | 交流伺服电机|直流伺服|伺服驱动器|伺服电机-深圳市华科星电气有限公司 | 螺旋丝杆升降机-SWL蜗轮-滚珠丝杆升降机厂家-山东明泰传动机械有限公司 | 台湾Apex减速机_APEX行星减速机_台湾精锐减速机厂家代理【现货】-杭州摩森机电 | 伶俐嫂培训学校_月嫂培训班在哪里报名学费是多少_月嫂免费政府培训中心推荐 | 热工多功能信号校验仪-热电阻热电偶校验仿真仪-金湖虹润仪表 | 断桥铝破碎机_铝合金破碎机_废铁金属破碎机-河南鑫世昌机械制造有限公司 | 东莞市天进机械有限公司-钉箱机-粘箱机-糊箱机-打钉机认准东莞天进机械-厂家直供更放心! | 热处理温控箱,热处理控制箱厂家-吴江市兴达电热设备厂 | 北京三友信电子科技有限公司-ETC高速自动栏杆机|ETC机柜|激光车辆轮廓测量仪|嵌入式车道控制器 | 聚合甘油__盐城市飞龙油脂有限公司 | 电动高尔夫球车|电动观光车|电动巡逻车|电动越野车厂家-绿友机械集团股份有限公司 | 砍排机-锯骨机-冻肉切丁机-熟肉切片机-预制菜生产线一站式服务厂商 - 广州市祥九瑞盈机械设备有限公司 | 昆山新莱洁净应用材料股份有限公司-卫生级蝶阀,无菌取样阀,不锈钢隔膜阀,换向阀,离心泵 | 企小优-企业数字化转型服务商_网络推广_网络推广公司 | 宠物店加盟_宠物连锁店_开宠物店-【派多格宠物】 | 储气罐,真空罐,缓冲罐,隔膜气压罐厂家批发价格,空压机储气罐规格型号-上海申容压力容器集团有限公司 | 北京企业宣传片拍摄_公司宣传片制作-广告短视频制作_北京宣传片拍摄公司 | PCB厂|线路板厂|深圳线路板厂|软硬结合板厂|电路板生产厂家|线路板|深圳电路板厂家|铝基板厂家|深联电路-专业生产PCB研发制造 | 深圳装修_店面装修设计_餐厅设计_装修全包价格-尚泰装饰设计 | MES系统-WMS系统-MES定制开发-制造执行MES解决方案-罗浮云计算 | 济南拼接屏_山东液晶拼接屏_济南LED显示屏—维康国际官网 | 硬度计,金相磨抛机_厂家-莱州华煜众信试验仪器有限公司 |