Christian-health / StudyNote2017

2017年学习笔记
0 stars 0 forks source link

webpack 官方文档之entry-points #49

Open Christian-health opened 6 years ago

Christian-health commented 6 years ago

https://doc.webpack-china.org/concepts/entry-points

Christian-health commented 6 years ago

demo1

Christian-health commented 6 years ago

demo2

Christian-health commented 6 years ago

demo3

Christian-health commented 6 years ago
"entry": {
    "main": [
        //这里会把main.ts相应的所有的文件打包生成一个main.随机数.bundle.js
      "./src/main.ts"
    ],
    "polyfills": [
       //这里会把polyfills.ts相应的所有的文件打包生成一个polyfills.随机数.bundle.js
      "./src/polyfills.ts"
    ],
    "scripts": [
    //这里会把scripts数组中的所有js文件打包到一起生成一个script.随机数.bundle.js这样的文件
    //这里是需要改进的,我可以把scripts拆分成scripts1然后是部分数组,然后是scripts2部分数组,然后是scripts3部分数组
      "script-loader!./node_modules/jquery/dist/jquery.min.js",
      "script-loader!./node_modules/tether/dist/js/tether.js",
      "script-loader!./node_modules/bootstrap/dist/js/bootstrap.min.js",
      "script-loader!./node_modules/echarts/dist/echarts.js",
      "script-loader!./node_modules/underscore/underscore-min.js",
      "script-loader!./node_modules/bootstrap-table/dist/bootstrap-table.js",
      "script-loader!./node_modules/bootstrap-table/dist/bootstrap-table-locale-all.min.js",
      "script-loader!./node_modules/d3/build/d3.min.js",
      "script-loader!./node_modules/xlsx/xlsx.js",
      "script-loader!./node_modules/js-yaml/dist/js-yaml.min.js",
      "script-loader!./node_modules/js-yaml/dist/js-yaml.js",
      "script-loader!./src/assets/libs/date_time/WdatePicker.js",
      "script-loader!./src/assets/libs/date_time/calendar.js"
    ],
    //这里生成styles.随机数.bundle.css文件
    "styles": [
      "./src/styles.less"
    ]
  },
Christian-health commented 6 years ago

output