Building JavaScript Class Library development environment based on rollup

Source: Internet
Author: User
Usually in the development process, accumulated a lot of experience and skills are applied to the project, and the next time you use it began to turn around. Sometimes also want to build a class library or toolkit to accumulate their own experience skills, and no special time to build a variety of environments, such as rollup or webpack such as packaging tools, ES6 transcoding tools Babel, Eslint, jest test tools and so on. Here is deliberately done a starter project, will rollup, ES6 transcoding, Eslint, jest are integrated, peacetime use only need to accumulate modules and methods. This article refers to: based on Webpack and ES6 to build JavaScript class library http://web.jobbole.com/84858/, because the Webpack Packaging class library comes with a small loader, a bit redundant, so choose Rollup build. # Key Notes 1. Use the ' JS API ' provided by ' rollup.js ' to package ' bundle ' 2. Using the ' ES2015 ' syntax in the ' Babel ' transcoding class Library, the ' module ' is not converted and handled by ' Rollup ' 3. The ' Node ' version is larger than ' 7.10.1 ' because the build script uses ' await ', ' async ' 4. Unit testing using ' jest ' while using ' Rollup-plugin-babel ' conversion test script syntax, config file '. BABELRC ' in ' Test ' section 5. The generation of ' Sourcemap ' is completed by ' Bundle.write ', and the transcoded source code is written to the last project address by the ' FS ' module: Https://github.com/Jinqw/rollup-libray-starter Hope that we can all the usual efforts to accumulate, the ultimate base into their own technical high-rise.

Building JavaScript Class Library development environment based on rollup

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.