Webpack Framework Knowledge Finishing--entry Points,output

Source: Internet
Author: User

2 is mainly related to the entry starting point mentioned in the previous essay and other relevant importance description and configuration instructions

2.1 Single entry for applications or tools with only one entry starting point: Single entry syntax: Entry:string| Array<string>

2.2 The most extensible way to define portals in an application is to use objects, separating the point of interest (concern) from the environment (environment), the build target, the runtime (runtime). Then use specialized tools, such as webpack-merge, to merge them. The object syntax is: entry: {[entrychunkname:string]: string| Array<string>}

3 is mainly related to the output mentioned in the previous essay on the importance of the description and configuration instructions

3.1 Output Controls how Webpack writes the compiled file to the hard disk. Note that even if multiple 入口 starting points can exist, only one 输出 configuration is specified

3.1.1

    output: {

        filename: ‘bundle.js‘,//这是输出的文件名

        path: ‘/home/proj/public/assets‘ //这是输出文件名对应文件存放的位置(绝对路径)

/span> < Span class= "token punctuation" >}

< Span class= "token punctuation" > 3.1.2

   output: {       filename: ‘[name].js‘,//这里使用的是占位符,对应于多个单独的 "chunk"的入口文件的名称,保证唯一性    path: __dirname + ‘/dist‘   }

  

Webpack Framework Knowledge Finishing--entry Points,output

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.