<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ### 名詞 * bundle, 打包之后生成的文件, 翻譯是: 包,束 * chunk, 代碼塊, 翻譯:大塊。 多個chunk合在一起就是bundle。 ### 快速實例 1. 安裝Node.js 2. 安裝webpack 3. 創建項目目錄和編寫代碼 , 這里的項目名字是webpack, 該目錄下的src目錄存放源碼。 webpack\src - hello.js , 作為被引用的子模塊文件。定義一個hello()的方法。 - index.js, 導入hello模塊,并調用hello()函數。 4. 配置webpack.config.js 這里以index.js為入口文件進行打包,打包到dist\bundle.js文件中。 ``` const path = require('path'); module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js' } }; ``` * entry, 入口,配置需要打包的入口文件 * output, 打包后的路徑和文件名配置 5. 在命令行執行webpack命令打包, 命令執行完成,會在項目路徑下產生dist\bundle.js。該文件的內容基本是看不懂了。 6. 使用打包后的文件,進行驗證。 在項目目錄下創建index.html文件,內容如下: ``` <!doctype html> <html> <head> </head> <body> <script src="dist/bundle.js"></script> </body> </html> ``` 使用瀏覽器打開該文件既可以看到效果了。 ### package ``` npm -y init ``` 產生 package.json 文件, 該文件是npm的模塊描述文件。 ``` npm run test npm run dev ``` npm run script執行的時候會創建一個Shell,這個shell 將當前目錄的可執行依賴目錄(node_modules/.bin)添加到環境變量path中,執行之后恢復原樣。會直接找到node_modules/.bin對應的腳本,而不需要加上路徑。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看