code before it can run.
Use JSX in Vue
The Vue framework does not specifically support JSX. In fact, it does not need to be supported because JSX will eventually compile as a standard JavaScript code. In this case, why can Vue and JSX be used together? It's easy, because Vue supports Virtual DOM, you can use JSX or other preprocessing languages, as long as the render method works properly.
Vue officially provides a plug-in called babel-plugin-transfo
Webpack Common plug-in installation commands:1:npm Install Html-webpack-plugin--save-dev//automatically quickly help us to generate HTML. 2:npm Install Css-loader style-loader--save-dev//style file, we need two kinds of loader,css-loader and Style-loader,css-loader will traverse CSS file , find all the URLs (...) and processing. Style-loader will insert all the styles into a style tag on your page. 3:npm Install Babel-loader css-loader style-loader--s
Webpack Common plug-in installation commands:1:NPM Install Html-webpack-plugin--save-dev//automatically quickly help us to generate HTML.2:NPM Install Css-loader style-loader--save-dev//style file, we need two kinds of loader,css-loader and Style-loader,css-loader will traverse the CSS file, Find all the URLs (...) and processing. Style-loader will insert all the styles into a style tag on your page.3:NPM Install Babel-loader css-loader style-loader--
--hot " }, " keywords ": [], " author ":", "license": "ISC"}// index.htmlsrc= "http://localhost:8080/ Bundle.js ">//Note src Properties v. New Webpack.config.js fileCreate a new Webpack.config.js file under the project directory with the following contents:Module.exports = { entry: + "/app/main.js",// The only entry file output that has been mentioned several times : { + "/build",// The place where the files are packed after filename : "bundle.js"// file name of the output file a
Create-react-app is a 0 configuration command-line tool from Facebook that helps you automatically create WEBPACK+ES6-based react project templates1: First create a new project in Webstorm2: If it is not the latest version of NPM, install the latest version of NPMNPM Install NPM @latest3: Related configurations commonly used in Setup projectsYarn Add React-redux redux redux-thunk react-router-dom thunk [email protected] Babel-plugin-transform-decorato
"
Inline
Set to true , automatically refresh the page when the source file changes
Historyapifallback
Very useful when developing a single page application, it relies on the HTML5 history API, and if set to true , all jumps will point to index.html
Module.exports = { ' eval-source-map ', entry: + '/app/main.js ', output: { + "/public", "Bundle.js" }, devserver: { "./public",// The directory where the local server loads the page
Objective:After grunt, gulp to achieve automation, Webpack also lead the front-end packaging trends, it is well known that VUE-CLI scaffolding is based on the Webpack project packaging. While Webpack is still rising momentum, another package artifact turned out--parcel.Parcel Fast, 0 configured WEB application featuresQuick Pack Parcel uses worker processes to enable multi-core compilation and has a file system cache that can be rebuilt quickly even after a reboot.Package All ResourcesParcel
ObjectiveBuilding the development environment of the former, can be developed. However, in the actual project, different environments have different construction needs. Here, the configuration of the development environment and production environment is extracted separately, and some simple optimizations are made.
Separate public configurations for different environments
Although different environments have different construction needs, but still have the same part, here will be pa
the MAC environment, win under the basic difference is not too much
1. Create a new state directory under the specified directory (command line operation)
mkdir State
2. Initialize the project with yarn (command line operation)
CD State
yarn Init
In the above steps all the way to enter
3. Install some dependencies (command line operation)
Yarn Add react react-dom webpack webpack-dev-server babel-core babel
Adding \ Config\polyfills.js to the project Adding \config\webpack.config.dev.js to the project Adding \config\webpack.config.pro D.js to the project Adding \config\webpackdevserver.config.js to the project Adding \config\jest\csstransform.js to the Project Adding \config\jest\filetransform.js to the project Adding \scripts\build.js to the project Adding \scripts\sta Rt.js to the project Adding \scripts\test.js to the projectupdating the dependencies removing react-scripts from Depende Ncies A
for us and has specific colors for annotations. If you try to write some code, you will find that, it also supports matching of parentheses and even error prompts.
This example shows the power of the Language Service. The functions mentioned above are implemented by the Language Service.
Initial look code host package
Any one or more services can be integrated into vs in the form of packages, and language services are no exception. In fact, language services must be extended in this way. I
1, the first global installation BABEL-CLI, the input command npm install babel-cli-g2, input CD d:\es6 ; ---Enter the folder path 3, enter NPM init, go to the---(Guide you to create a Package.json file, including name, version, author, etc.) 4, enter NPM install--save-dev BABEL-CLI;---(Install command line transcoding BABEL
IntroducedVue.js is a client JS library that can be used to develop a single page application. For a project selection, I looked up and down angular, react, Vuejs, to the former two is to admire, the latter is love. Because it's neat and clean, and there's a huge web of components to implement. Even if there are not many documents, I would like to choose it. Next, we start by building a starting project, and we'll go through the concepts and components involved in the development process.Vue.jsA
Write in front:This configuration supports ES6, less1. FirstGive the initial directory structureGives the directory structure after executing the gulpGives the directory structure after executing gulp--p2.package.json is a write. The file describes the configuration information for the NPM package (author, profile, package dependencies, etc.) and the required modules.{ "name": "Grunttest", "version": "1.0.0", "description": "", "main": "Gulpfile.js"}3.gulpfile.js adding a task to performvar
Webpack is a module packager, any static resources (js, css, pictures, Etc.) can be regarded as modules, and then can be interdependent between the modules, through the Webpack module processing, can be packaged into the static resources we Want.Gulp Packaging is the js, css, pictures and other packaging separately, but Webpack is all the static resources packaged together, so a request can Be.Features of • Support Commonjs (require) and AMD modules, which means you can migrate old items without
I. OverviewES6 is now in its prime, companies are trying to use, and as a front-end engineer ES6 is also the highlight of Technology. however, the current browser is not particularly compatible with ES6 support, and ultimately the need to convert ES6 to Es5,webpack using the babel-loader loader for conversion, its configuration is very easy.second, the configuration Babel-loaderIf you do not have the ES6 gr
Prerequisite: Nodejs and NPM have been installed#全局安装webpack Automated Building tools, functional Management projects; Webpack-dev-server is a development tool that provides hot Module replacement functionality# Webpack Introduction: http://webpack.github.io/docs/what-is-webpack.htmlInstall -g webpack webpack-dev-server#在项目文件夹路径下, Initialize the NPM projectNPM Init#安装webpack和webpack-dev-server to the projectInstall Webpack Webpack-dev-server--save-dev#可选:#安装css-loader, style-loader, image-loader
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.