Created
May 21, 2016 11:21
-
-
Save suzuki-shunsuke/76aee488e2641114f8f8dd9acacbbae7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": ["es2015"], | |
"plugins": ["transform-runtime"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var mv = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) | |
/******/ return installedModules[moduleId].exports; | |
/******/ // Create a new module (and put it into the cache) | |
/******/ var module = installedModules[moduleId] = { | |
/******/ exports: {}, | |
/******/ id: moduleId, | |
/******/ loaded: false | |
/******/ }; | |
/******/ // Execute the module function | |
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | |
/******/ // Flag the module as loaded | |
/******/ module.loaded = true; | |
/******/ // Return the exports of the module | |
/******/ return module.exports; | |
/******/ } | |
/******/ // expose the modules object (__webpack_modules__) | |
/******/ __webpack_require__.m = modules; | |
/******/ // expose the module cache | |
/******/ __webpack_require__.c = installedModules; | |
/******/ // __webpack_public_path__ | |
/******/ __webpack_require__.p = ""; | |
/******/ // Load entry module and return exports | |
/******/ return __webpack_require__(0); | |
/******/ }) | |
/************************************************************************/ | |
/******/ ([ | |
/* 0 */ | |
/***/ function(module, exports) { | |
let mv = {}; | |
/***/ } | |
/******/ ]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test with node 6.2.0 and 4.4.4 | |
$ nodebrew use 6.2.0 | |
$ node --version # v6.2.0 | |
$ npm --version # 3.8.9 | |
$ npm install | |
$ npm run babel | |
$ npm run webpack | |
$ rm -R node_modules | |
$ nodebrew use 4.4.4 | |
$ node --version # v4.4.4 | |
$ npm --version # 2.15.1 | |
$ npm install | |
$ npm run babel | |
$ npm run webpack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mv = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "foo", | |
"version": "1.0.0", | |
"description": "", | |
"main": "aap/index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"webpack": "webpack", | |
"babel": "babel index.js > build-babel.js" | |
}, | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { | |
"babel-cli": "^6.9.0", | |
"babel-core": "^6.9.0", | |
"babel-loader": "^6.2.4", | |
"babel-plugin-transform-runtime": "^6.9.0", | |
"babel-preset-es2015": "^6.9.0", | |
"babel-register": "^6.9.0", | |
"babel-runtime": "^6.9.0", | |
"webpack": "^1.13.1" | |
}, | |
"dependencies": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import path from 'path'; | |
import webpack from 'webpack'; | |
module.exports = { | |
entry: { | |
'index': './index.js', | |
}, | |
externals: { | |
}, | |
resolve: { | |
modulesDirectories: ['node_modules', 'bower_components'], | |
}, | |
plugins: [ | |
new webpack.optimize.DedupePlugin(), | |
new webpack.optimize.AggressiveMergingPlugin(), | |
// new webpack.optimize.UglifyJsPlugin(), | |
], | |
output: { | |
path: path.join(__dirname), | |
filename: 'build-webpack.js', | |
}, | |
loaders: [{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
loader: 'babel-loader', | |
query: { | |
preset: ['es2015'], | |
plugins: ['transform-runtime'] | |
} | |
}] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment