profile-loader

1.0.4 • Public • Published

profile-loader

Delete the specified code according to the profile building time.

构建时根据profile,删除掉指定代码,从而可以用来打出不同的包。

Guide 使用指南

Install

npm install profile-loader

In webpack config

            {
                test: /\.(vue|js)$/,
                use: {
                    loader: "profile-loader",
                    options: {
                        profile: "profile1" // or profile2,profile3...
                    }
                }
            }

In source code

/*include profile1 profile2 start*/
background-image: url("../assets/image/banner.png");  /* If profile is not profile1 or profile2, this line would be removed */
/*include end*/
/*exclude profile2 profile3 start*/
background-image: url("../assets/image/banner_1.png"); /* If profile is profile2 or profile3, this line would be removed */
/*exclude end*/

Readme

Keywords

none

Package Sidebar

Install

npm i profile-loader

Weekly Downloads

5

Version

1.0.4

License

MIT

Unpacked Size

5.58 kB

Total Files

4

Last publish

Collaborators

  • saoraozhe3hao