REACT-TODOMVC Scaffolding

Source: Internet
Author: User

    • Webpack.config.js
var path = require (' path '); The module for path resolution in node const Htmlwebpackplugin =require (' Html-webpack-plugin '); module.exports = {//Portal File entry: './src/app. JS ',//Export file output:{//Export file name filename: ' index.js ',//Export file path Path:path.resolve (__dirnam    E, ' Dist '), Publicpath: "/"},//webpack-dev-server Server directory Devserver: {contentbase: './dist/'},            Plug-in plugins:[//automatically generate HTML files in the export path, the function can accept an object: template for generating a new HTML file of the templates file new Htmlwebpackplugin ({            Template: './src/index.html '}],//module processing module:{//Processing rules rules:[//processing CSS {//matching file test:/\.css$/,//loader used, processing order from post to forward processing use:['            Style-loader ', ' css-loader '},//Processing file: img ... {//Match file test:/\. (png|jpg|gif) $/, use:[{loader: ' Url-loader ',//loader some of the files when processingConfiguration options options:{//Size limit (in bytes): Less than 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 unsupported issues presets:[' env ', ' react ', ' stage-0 '}}}}}
    • Package.json
{  "name":"webpack-demo",  "version":"1.0.0",  "description":"",  "main":"index.js",  "scripts":{      "webpack":"webpack",      "start":"webpack-dev-server --open"  },  "author":"",  "license":"ISC",  "devDependencies":{      "babel-cli":"^6.26.0",      "babel-core":"^6.26.0",      "babel-loader":"^7.1.2",      "babel-preset-env":"^1.6.1",      "babel-preset-react":"^6.24.1",      "babel-preset-stage-0":"^6.24.1",      "css-loader":"^0.28.7",      "file-loader":"^1.1.5",      "html-webpack-plugin":"^2.30.1",      "style-loader":"^0.19.0",      "url-loader":"^0.6.2",      "webpack":"^3.10.0",      "webpack-dev-server":"^2.9.7"  },  "dependencies":{      "react":"^16.2.0",      "react-dom":"^16.2.0"  }}

REACT-TODOMVC Scaffolding

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.