Solve the error reported by UglifyJs during iview packaging, iviewuglifyjs
The run time is OK when npm run dev is used, but iview reports an error when npm run build is packaged,
As follows:
The reason is that es6 syntax is used in iview, but uglifyJs does not support it. Open the build/webpack. prod. conf. js file and you can see
// UglifyJs do not support ES6+, you can also use babel-minify for better treeshaking: https://github.com/
concept of chunk ,Chunk represents a file , by default Webpack input is a portal file, the output is a file, this file is a chunk, Chunkid is the output when giving each file a unique identifier Id,chunkhash is the MD5 value of the file content, and name is the key value specified in the entry.Module.exports = { entry: { collection: './src/main.js ' //collection is chunk's name, chunk's entry file is Main.js } , output: { path: './dist/js ', filename: ' [name].
modules for whic H This installation technique is useful. When we use NPM scripts, NPM looks for locally installed webpack, which resolves the version issue, and each project uses a local installation webpack, which does not affect each other. so local installation is recommendedCore concepts of the 3,webpack configuration file (webpack.config.js)After installing Webpack, we also carried out a simple packaging operation, which is actually the basis of webpack as a packaging tool. If our JS code
Using ES6
To use ES6, we need loader.
Modify webpack.config.js File:
Module.exports = { './index.js ', output: { ' bundle.js ', path: __dirname }, module: { loaders: [ /\.js$/, loader: ' Babel ', exclude: '/node_modules/'} ] }};We Add Module property, which are an object. We define the Loaders property Here which are an array of objects.
Test: It is a regex, would inclu
Recently, because of working relationships, I have been doing the development of node. js, learning the KOA Framework, ORM Framework Sequelize, and the configuration of swagger documents. However, because the swagger document uses a ES6 decorator (called Annotations in Java) recently, node. JS cannot compile the project, so you need to convert ES6 using Babel. Because this article is to write, how to configure the use of the
', ' static/**/*.html '], Fu
Nction (file) {server.notify.apply (server, [file]);
});
});
Gulp-livereload, you can save the refresh in real time, so you don't have to press F5 and switch interfaces.Gulp-load-plugins: Automatically load any gulp plugins in your Package.json file
$ NPM Install--save-dev Gulp-load-plugins
For example, a given Package.json file is as follows:
{"
dependencies": {"
gulp-jshint": "*",
"Gulp-concat": "*"
}
}
Add t
a delivery evaluation program, checking out a successful order, sending the invoice to the customer via email, and starting the delivery process for the toy.
In this tutorial, you will learn how to do the following:
Install Eclipse STP, Eclipse ATL, BABEL bpmn2bpel tools, and Apache ODE
Establishing a business process model in the Eclipse STP
Converting the BPMN format of the Eclipse STP into a BABEL B
using let, so that it does not affect the variable of the same name outside the scope, which is the same behavior as most other programming languages.
Click the picture to view the larger image
Preventing duplicate declarations of variables
ES6 does not allow you to repeatedly declare variables of the same name with let or const in the same scope. This is useful to prevent duplicate declarations of function expressions in different JS libraries.
For example, the Add function in the following
Sublime text is almost any developer's prerequisite application in its toolbox. Sublime text is a cross-platform, highly customizable, advanced text editor for a fully functional IDE (a scarce resource) and for matching command-line editors, such as Vim and Emacs (with a steep learning curve).
One of the reasons why Sublime text is so popular is its extensible plug-in architecture. This allows developers to extend the core functionality of sublime by easily using new features, such as code comp
This paper introduces the construction process of vue2.0+webpack environment.
1. First create a new directory Vue-wkdemo, this is our project directory. Execute the NPM init command to generate the Package.json file. After you perform NPM init, you will be prompted to fill in some project information, always return to the default, or directly execute NPM init-y to skip the inquiry step directly.
2. Installation Project Dependencies
NPM Install Webpack webpack-dev-server vue-loader vue-
exact equality operator considers Nan not equal to itself.Here a lot of students will say, now a lot of browsers do not support ES6 syntax, use is also equal to white, then here I am in the introduction of something. It is called Babel;First we install it through NPM.So we can use the Babel command, of course, you can also change the file root directory to inject it into the dependencyThen install a
developers, each of which can help you improve your workflow and make it more efficient. Next, let's get started!
1. Babel
The first is the Babel plug-in. The plug-in adds appropriate syntax highlighting to ES6/2015 and React JSX code. After installing the plug-in, the first thing you need to do is set the default syntax to. es6,. jsx, And even. js files. However, if you work on ES3/5 and do not want to us
projects as project files and packages them. In actual development, we need to install a lot of NPM extension libraries, which contain a large number of files that do not need to be packaged. for example, lodash contains thousands of files, however, we only need to use a very small part of it.
In addition, during development, we often need to install babal, eslient, webpack, and grunt to wait for the development tool, mini-program development tools will also package the source code of these too
format. So found the Webpack-utf8-bom this plugin to solve the problem smoothly.The rest of the information is in the notes.With the introduction, loading, and packaging of webpack resources, is everything so natural that I can still not like it?Package.json seems a bit incomplete, not all just press Webpack.config.js to find it.{"name": "src", "version": "1.0.0", "description": "$", "main": "Webpack.config.js", "dependencies": {"babel-c Ore ":" ^6.1
First, the necessary plug-in1. BABEL:ES6 syntax support, requires babel-perset-es2015 (convert to ES5 execution), Babel, Babel-core (program execution) 2. Commander: Custom Command Plug-in, provide parameter delivery, etc. 3. Liftoff: Implements input monitoring of the command window, as well as the command format specification. 4. Minimist: Read command line par
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.