《玩转webpack》 第四章 进阶篇: 编写可维护的 webpack 构建配置原理篇:编写 Loader 和插件 08 | 实战篇:React 全家桶 和webpack 开发商城项目 ## ☐ ☐ ☐ ☐ ## 扫码试看/订阅 《玩转webpack》 ## 构建配置抽离成 npm 包的意义 通用性 ·业务开发者无需关注构建配置 ·统一团队构建脚本 可维护性 ·构建配置合理的拆分 ·README 文档、ChangeLog 文档等 质量 ·冒烟测试、单元测试、测试覆盖率 ·基础配置:webpack.base.js ·开发环境:webpack.dev.js ·生产环境:webpack.prod.js ·SSR环境:webpack.ssr.js ## 抽离成一个 npm 包统一管理 ·规范:Git commit日志、README、ESLint 规范、Semver 规范 ·质量:冒烟测试、单元测试、测试覆盖率和 CI ## 通过 webpack-merge 组合配置 3', () => { expect(add(1, 2).to.equal(3)); }); }); ## 单元测试接入 1. 安装 mocha + chai npm i mocha chai -D 2. 新建 test 目录,并增加 xxx.test.js 测试文件 3. 在 package.json 中的 scripts 字段增加 test 命令 "scripts":0 码力 | 30 页 | 5.38 MB | 2 年前3
The Node.js Handbook
14. Accept input from the command line in Node 15. An introduction to the npm package manager 15.1. Introduction to npm o 15.2. Downloads ■ 15.2.1. Installing all dependencies ■ 15.2.2. Installing packages 15.3. Versioning 15.4. Running Tasks • 16. Where does npm install the packages? • 17. How to use or execute a package installed using npm • 18. The package.json guide 18.1. The file structure 18 package-lock.json file 19.1. An example • 20. Find the installed version of an npm package • 21. Install an older version of an npm package • 22. Update all the Node dependencies to their latest version0 码力 | 161 页 | 1.66 MB | 2 年前3
BabelJS Tutorialset up the environment for BabelJS. To work with BabelJS we need the following setup: • NodeJS • Npm • Babel-CLI • Babel-Preset • IDE for writing code ## NodeJS To check if nodejs is installed on Once nodejs is installed, npm will also be installed along with it. To check if npm is installed or not, type `npm -v` in the terminal. It should display the version of the npm.  在命令行输入 npm install -g gulp 若一直没安装成功,请使用 cnpm 安装(npm的国内加速镜像) 意思是:使用 意思是:使用 npm 安装全局性的 $ (-g) $ gulp 包。 如果你安装失败,请输入 sudo npm install -g gulp 使用管理员权限安装。(可能会要求输入密码) 安装时请注意命令行的提示信息,安装完成后可在命令行输入 gulp -v 以确认安装成功。 至此,我们完成了准备工作。接着让 gulp 开始帮我们干活吧! ## 使用 gulp 压缩 JS 压缩 js 代码可降低 七、 安装 gulp-uglify 模块 本文档使用 看云 构建 gulp 入门指南 因为我们并没有安装 gulp-uglify 模块到本地,所以找不到此模块。 使用 npm 安装 gulp-uglify 到本地 npm install gulp-uglify 安装成功后你会看到如下信息: gulp-uglify@1.1.0 node_modules/gulp-uglify — deepmerge@00 码力 | 36 页 | 275.87 KB | 2 年前3
The Next.js Handbook
the latest LTS version listed on https://nodejs.org/. After you install Node.js, you will have the npm command available into your command line. If you have any trouble at this stage, I recommend the following tutorials I wrote for you: • How to install Node.js • How to update Node.js • An introduction to the npm package manager • Unix Shells Tutorial • How to use the macOS terminal • The Bash Shell Now that 7bb49bf189239143a58d2315426/p10_1.jpg) and you can immediately run the sample app by running $ npm\ run\ dev $ :  And0 码力 | 54 页 | 2.61 MB | 2 年前3
ThinkJS 2.2 Documentationcommand: npm install thinkjs@2 -g --verbose After installation, run thinkjs --version or thinkjs -V to check version number. Tips: If you have installed ThinkJS 1.x before, you need remove it by `npm uninstall ThinkJS globally by run the following command: npm install -g thinkjs@2 Bash Update ThinkJS in your current project by run the following command: npm install thinkjs@2 Bash ## User thinks command demo/app/home/view/index_index.html enter path: $ cd demo/ install dependencies: $ npm install run the app: $ npm start For more details about creating project, go to extension function -> ThinkJS0 码力 | 156 页 | 2.62 MB | 2 年前3
nativescript tutorialNativeScript application. Node.js package manager npm is used to install NativeScript CLI on your machine. Use the below command to install NativeScript CLI: npm install -g nativescript After executing this project are node based project, it stores all its dependencies in the node_modules folder. We can use npm (npm install) or tns to download and install all the application dependency into the node_modules. ## • color • text/formatted-string • xml • styling • animation # 12. NativeScript — Plugins The npm package is used for adding native functionality. Using this package, we can install or search or delete0 码力 | 106 页 | 2.59 MB | 2 年前3
共 414 条
- 1
- 2
- 3
- 4
- 5
- 6
- 42
相关搜索词
Webpack构建配置npm 包测试覆盖率ESLintNode.jsJavaScriptnpmV8引擎事件循环BabelJSpresetplugintranspilingpolyfillsGulp任务运行器自动化配置文件Electron跨平台桌面应用ChromiumRxJSObservableObserverSubscriptionSubjectgulpfile.jsgulp-uglifygulp-imagemingulp-sourcemapsNext.js服务器端渲染自动代码分割静态导出TypeScript支持ThinkJSMVC框架ES6/7TypeScript自动更新NativeScriptAngularUI Components













