webpack學習!lession4 安裝ES6解析

一、命令行安裝!javascript

    1.一、安裝webpack 4.x | babel-loader 7.x | babel 6.xjava

npm install -D babel-loader@7 babel-core babel-preset-env webpack

    1.二、安裝node

npm install babel-preset-es2015 --save-dev

    1.三、webpack

npm install babel-preset-latest --save-dev

二、配置文件:web

    2.一、webpack-dev-config.jsnpm

rules:[
            {
                test: /\.js$/,
                exclude: /(node_modules|bower_components)/,
                use:{
                    loader: "babel-loader",
                }
            }

 2.二、.babelrcjson

    

{
    "presets": ["es2015","latest"],
    "plugins": []
}
相關文章
相關標籤/搜索