", "Elm ”]
Dependencies
The production of this package relies on the automatic installation of these dependencies when the user installs your
"Dependencies": {"react": "^15.1.0", "react-native": "^0.27.0-rc2"}
Devdependencies
This package is dependent on the development or testing phase and will not be packaged into the final production packages
"Devdependencies": {"Babel-eslint": "^5.0.0", "Eslint": "^2
name is called:react_webpack_test Bar.
Click OK to enter the interface. Then open the Preferences setting for Webstorm (Windows is file-settings), select Jsx Harmony in Languages Frameworks JavaScript column, click OK.
reopen the command line, enter sudo npm install webpack webpack-dev-server Babel-gsudo npm install react react-dom babel-loader Less-loader css-loader style-loader url-loader file-loa
Today review the next Webpack common loaders, in fact, ES6 development, Webpack config.js Basic configuration should be relatively fixed:First of all, JS, we ES6 to convert to ES5, need to use Babel transcoding:1.NPM Install--save-dev Babel-loader babel-core2. Configure in Config.js:1 module: {2 rules: [3 {test:/\.js$/, exclude:/node_modules/, Loader: "
by loaders (must)
Name of the Loader:loader (required)
Include/exclude: Manually add files (folders) that must be processed or block files (folders) that you do not need to process (optional);
Query: Provides additional setup options for loaders (optional)
Pretreatment of Loaders
Css-loader handling issues such as path references in CSS
Style-loader dynamically writing styles to CSS
Sass-loader Scss Compiler
Less-loader less compiler
Postcss-loader scss
it again, with NPM Scripts.Let me start with a brief introduction to NPM Scripts. Take a look at the code First.{"name": "app", "version": "0.0.1", "private": true, "main": "./bin/www", "scripts": {"clean": "rm-rf Client/di st/* "," copy ":" rsync-a--exclude=*.html--exclude=*.jsx./client/src/*.*./client/dist "," start ":"./bin/www ", "server": "node server.js", "build": "npm run clean webpack--config webpack.config.pro.js npm ru N Copy node qiniu.js "}," dependencies ": {"
of plug-ins, remember that these plugins are also downloaded in node. js, we just need to enter the command to download it.Plugin One: npm install--save-dev babel-core babel-loader babel-preset-es2015 babel-preset-reactPlugin II: NPM install--save-dev style-loader css-loaderInstalling WEBPACK:NPM Install--save-dev Web
-dev
2, install the ES6 transcoding device, es6 some new syntax features the old version of the browser can not be recognized, you need to convert it to ES5 syntax through a transcoding device.
NPM i babel-core babel-loader babel-preset-env--save-dev
3, configure transcoding files, create a new file named. BABELRC, the content is as follows:
{
"Presets": [
"React
information.1 {2"Name": "Webpacktest",3"Version": "1.0.0",4"description": "",5"Main": "Index.js",6"Scripts": {7"Test": "Echo \" Error:no test specified\ " exit 1"8 },9"keywords": [],Ten"Author": "", One"License": "ISC", A"Devdependencies": { -"Webpack": "^4.1.0" - } the}To be based on react, you also need to install some necessary packages1 npm install react react-dom babel-core babel-loader
February 24, 2012
Juno
4.2 [2]
Juno projects
June 27, 2012
September 28, 2012
February 22, 2013
Kepler
4.3
Kepler projects
June 26, 2013
September 27, 2013 (planned)
February 28, 2014 (planned)
Luna
4.4
Luna projects
June 25, 2014 (planned)
N/A
N/A
old versionold version, still supportedCurrent VersionFuture Versions2. Login Language Pack official website: http:/
npm publish --registry http://ubuntu-17:4873 # --forceIn the Mydemo project we add referencesyarn add myHammer --registry http://ubuntu-17:4873Modify the index.js following:const myGreeting = require('myGreeting');const {base64} = require('myHammer');(function () { let greeting = myGreeting('Rattz'); console.log(base64.encode(greeting));})();Run up$ node index.jsSGVsbG8gUmF0dHo=About Tree ShakingMention a little bit about the tree Shaking, which simply says that tree Shaking can effectiv
How to Use ES6 in node and ES6 in node
ES6 + is great, but many advanced functions node is not supported, you need to use babel to convert to ES5,
1. Install babel Dependencies
Npm install babel-core -- save-dev
2. Install babel-register
Npm install babel-register -- sa
: ' Style-loader!css-loader '},{test:/\.js$/, Loader: ' Jsx-loader?harmony '},{test:/\.scss$/, Loader: ' Style!css!sass?sourcemap '},{test:/\. (png|jpg) $/, loader: ' url-loader?limit=8192 '}]},2.4 Other configurationsResolve: {Automatic extension of the file suffix means that we can omit the suffix name from the Require moduleExtensions: [', '. js ', '. json ', '. Scss ']},2.5 first refer to the directory structure in the exampleBuild holds compiled files, SRC holds react code folders, componen
Use webpack to build vue. js single-page applications are currently under development. To achieve frontend and backend separate development, we decided to use the vue just released. js 2.0 and koa 2.0 are developed, and webpack is used in depth as a front-end packaging tool. We plan to enhance our understanding of webpack through exercises for better understanding. Next, I will perform in-depth exercises on development-related technologies and write a series of articles.
The required dependen
|------index.js Component processing Master file |------root.js address jump profile |--- - Service |------index.js Service Request main file |------request.js Service Request File |----index.js main portal file /c8>|--index.html page entry file |--Package.json project information and installation profile |--server.js Service Port entry file |--
webpack.config.js Profile |--webpack.production.config.js (release) configuration file
View Code5, need to install the package, see Pac
ArticleDirectory
Start step by step
Run debugging
Review
In the previous two articles, we have studiedCodeStructure, understanding the basic components of a language service and how managed Babel works in language service. In the next two articles, I will start with an empty integration mode package and create a simple language service step by step: in this language, there is no syntax, the coloring tool is used to distinguish num
.?? This article is mainly to write a webpack development of the basic framework , the subsequent writing react simple example, build Bar command, index.html do not need to change, only need to pay attention to./APP/JSX the JSX code for the component in the directory.Source Address : Https://github.com/mqy1023/react-basejs/tree/master/src/dev-base/webpackI. REACT PROJECT structure/app /jsx index.htmlpackage.jsonwebpack.config.js.babelrcSecond, Webpack script
1. Create Package.json Manage
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.