webpack配置(第二步:入門篇)

關於webpack的項目文件:https://gitee.com/codeFarmerPen/webpackcss

安裝 webpack

cnpm安裝webpack:html

$ cnpm install webpack -g

備註:cnpm install webpack@版本號.0.0 -g //例如:webpack

$ cnpm install webpack@3.0.0 -g

         必定要記得版本號,4版本已經出了,不加版本號有時候會直接下載最新的(不穩定)版本。git

建立項目

基礎的理解部分建議直接看菜鳥教程,而後後面的內容是我本身配的,故而一些路徑文件,是根據個人思路來的,重在理解,重在理解。web

關於webpack的配置我總共配置了:npm

ES六、less、html-webpack-plugin配合ejs模板引擎生成html模板、css的url聯合配置。app

先來一發project目錄(這是完整的目錄,也是我配置好的最終目錄)less

        

        app:工程構建目錄,入口文件放在這裏;ui

        _build:文件產出目錄,產出的文件會放在這裏;url

        可去個人項目文件裏面複製,readMe裏面有一次性所有安裝的步驟:https://gitee.com/codeFarmerPen/webpack/blob/master/README.md

 

下面是我關於webpack配置的全部連接

webpack配置(第一步:配置前提):http://www.javashuo.com/article/p-zhierewo-eo.html

webpack配置(第二步:入門篇):http://www.javashuo.com/article/p-zgertkmc-mq.html

webpack配置(第三步:ES6篇):http://www.javashuo.com/article/p-yornwkpw-dt.html

webpack配置(第四步:html篇(基礎篇)):http://www.javashuo.com/article/p-ykguohhe-do.html

webpack配置(第四步:html篇(進階篇)):http://www.javashuo.com/article/p-nqgmvdah-hz.html

webpack配置(第四步:html篇(模板篇)):http://www.javashuo.com/article/p-cfrvmuzd-ea.html

webpack配置(第五步:less/css篇(基礎篇)):http://www.javashuo.com/article/p-ftegbnmw-p.html

webpack配置(第五步:less/css篇(進階篇)):http://www.javashuo.com/article/p-bkdzfetz-mx.html

webpack配置(第五步:less/css篇(url圖片篇)):http://www.javashuo.com/article/p-adtmrppc-mq.html

相關文章
相關標籤/搜索