(code compression, resource uploads)
dev.js
Special configuration of the development environment ( source-map )
dllis a very early routine, probably need to modify so many places:
Create a separate webpack file to generate the dll file
webpackmake a reference to a file in a normal file dll
// dll.js{ entry: { // 需要提前打包的库 vendors: [ 'react', 'react-dom', 'react-router-dom', 'babel-polyfil
purifycss-webpack purify-cssIntroduction of GlobBecause we need to check the HTML template synchronously, we need to introduce node's Glob object to use. Introduce glob in the Webpack.config.js file header.constc glob = require(‘glob‘);Introduction of PURIFYCSS-WEBAPCKconstc PurifyCSSPlugin = require("purifycss-webpack");Configure PluginsnewPurifyCSSPlugin({paths:glob.sync(path.join(__dirname,‘src/*.html‘)),})BabelTurn Es6 into ES5 grammarnpm i -D babel
= {7Entry: __dirname + "/app/main.js",//Unique Portal File8 output: {9Path: __dirname + "/build",//file path to output after packagingTenFileName: "Bundle-[hash].js"//file name of the output after packaging One }, ADevtool: ' None ', - //Add the Webpack-dev-server command to the Scripts object in Package.json to turn on the local server - devserver: { theContentbase: "./public",//The directory where the page loaded by the local server is located - //when developing a
A word summary: using Webstorm's own file Watcher function +babel to achieve automatic conversion ECMAScript 6 code for ES5 code1.Create a new empty Project, and then create a new main.js in the SRC directory;This step is not necessary, just get started. It will be much less disruptive to start your own configuration from an empty project.2.Enter settings to change JavaScript language version to ECMAScript 6;3.And then. Write a section of ES6 code'Use
directory on git?A : The specific directory structure can be seen here, one by one to describe the role of the various directories and files:
. GitHub
GIT-related directories
Build
Build the relevant script file, I probably read it, mainly to create two grunt tasks, responsible for building (bulid) and output (dist)
Dist
Outputs the built-in files, mainly Jquery.js and Jquery.min.js, as well as Jquery.min.map. These are the JS files we en
apt-Get install or download the latest version from the Apache website.2.1.5 install mod_wsgi (you can also install mod_python as needed, but we recommend that you use mod_wsgi because mod_wsgi is faster and mod_python has stopped development. Note that no matter what mod is installed, pay special attention to whether the Python version of this mod is consistent with the Python version to be run !!)Go to http://code.google.com/p/modwsgi/download mod_wsgito installYou can also install it through
VUE Project Combat 2----------------------------------------------------------------------------------------------59:13-----------------------------------------------Record a pit: app development picture Naming if you use the underline there may be some phones that don't show upPicture lazy loading -----------------------------------------------Module build failed:Error:Couldn ' t find preset "env" relative to Directory "F: \\VUE Project \\vue Combat 2"Cause of Error:The ENV option is set in the
At first, it was difficult and complicated to think of webpack, haha.Actually writing good things is really the simpler, the simpler things actually the more difficult to write.Follow the steps of how to understand the basic, how webpack use,The following is how to help the program to find the adapter step-by-step.But there are some pits that we need to crossLike what:Parser.pp.raise ,The basic problem of encountering such problems is that Babel is no
Build value is the package used by the command } ," author ":" ", "license": "ISC", "dependencies": { "webpack": "^3.0.0" }} View Code13. Run the NPM run build again14, install the configuration webpack-dev-server, realize the hot update.1. Perform NPM i webpack-dev-server--save-dev in cmd2. Modify the scripts in Package.json"Test": "Node_modules\.bin\webpack-dev-server--config./webpack/webpack.config.js--port 8089--open",View Code3, the index page JS, using absolute path, such as Htt
that has no publicpath value.2. After getting this value, use the Webpack official API compilation.assets[package to get the value].source () This is not the address, but the JS content.3. Use the template language to determine the reference JS.4. Pay special attention to whether the inject is automatically generated (5) Loader.Three ways to configure the 1.loader.1.loader in require adds the corresponding loader in the path directly to the Require file.2.CLI adds the--module-bind + correspondi
npm init -yInitialize project//-y to generate Package.json automatically, if you need to configure yourself, remove-yInstalling the various dependenciesnpm install --save vueInstalling vue2.0npm install --save-dev webpack webpack-dev-serverInstall Webpack and Webpack test server//default installation of the latest version of version 2.xnpm install --save-dev babel-core babel-loader
development environment NPM install Webpack--save-dev
Local installation to production environment NPM install Webpack--save
The specific definitions of these three environments can be queried on their own.Next need to install Babel (transcoding), React, React-dom, eslint (grammar detection), here I do not say the method of installation, directly put the configuration, we directlyInstall"Devdependencies": { "
plugins (Plugins)Plug-ins (Plugins) are used to extend the functionality of Webpack, which take effect throughout the build process and perform related tasks.Loaders and plugins are often confused, but they are really different things, so to say, loaders is used to process the source files during the package build process (jsx,scss,less. ), one process at a time, the plug-in does not directly manipulate a single file, it directly affects the entire build process.Webpack has a lot of built-in plu
Android Embedded page has a tab click actually did not respond, dizzy. But fortunately only in the hands of the Meizu phone has a problem, Huawei can, basically can be identified as compatibility issuesUse Devtools to view WebView Web page to see error messages such asIt is obvious that ES6 's generators entries function is not supported, then check the phone's Chrome kernel version is 51, check the Android chrome kernel compatibility, such as Android Chrome compatibility update so slow.Solve, o
After configuring the Appium environment in accordance with the online tutorial, the true machine runs the automated process, encountering the following error:Appium error is as follows:[ADB] Checking whether AAPT is present[adb] The android_home environment variable are not set to the ANDROID SDK root directory P Ath. Android_home is required for compatibility with SDK 23+. Checking along PATH for AAPT. [ADB] Error:could not find AAPT please set the ANDROID_HOME environment variable with the
this limit will be converted to Base64 Limit:10 24}}]},//handling react JSX syntax and ES6 syntax {// Match file test:/\.js$/,//Exclude all Files under Node_modules file Exclude:path.resolve (__dirname , ' node_modules '),//Use of loader information use:{loader: ' Babel-loader ', options:{//Presets used: Env handles ES6 syntax, react handles JSX syntax, stage-0 handles react for ES6 partial syntax unsupporte
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.