Created
April 5, 2015 07:36
-
-
Save yosisa/db670ca840f1a2afce3c to your computer and use it in GitHub Desktop.
webpack で始めるイマドキのフロントエンド開発 ref: http://qiita.com/yosisa/items/61cfd3ede598e194813b
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
$ npm install webpack -g |
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
$ cd /path/to/project | |
$ npm init | |
$ npm install webpack --save-dev |
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
<div id="demo"> | |
<div>{{message}}</div> | |
<input v-model="message"> | |
</div> | |
<script type="text/javascript" src="bundle.js" charset="utf-8"></script> |
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
$ webpack main.js bundle.js | |
Hash: 8bd5cc0129397bf5744f | |
Version: webpack 1.4.15 | |
Time: 256ms | |
Asset Size Chunks Chunk Names | |
bundle.js 181297 0 [emitted] main | |
[0] ./main.js 109 {0} [built] | |
+ 62 hidden modules |
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
module.exports = { | |
entry: './main.js', | |
output: { | |
path: __dirname, | |
filename: 'bundle.js' | |
} | |
}; |
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
$ webpack | |
Hash: 1e37faf49db800f67a24 | |
Version: webpack 1.4.15 | |
Time: 265ms | |
Asset Size Chunks Chunk Names | |
bundle.js 181297 0 [emitted] main | |
[0] ./main.js 109 {0} [built] | |
+ 62 hidden modules |
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
document.write("Hello 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
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<script type="text/javascript" src="bundle.js" charset="utf-8"></script> | |
</body> | |
</html> |
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
$ webpack main.js bundle.js | |
Hash: c2f39b0a6cfb9cd0d808 | |
Version: webpack 1.4.15 | |
Time: 28ms | |
Asset Size Chunks Chunk Names | |
bundle.js 1529 0 [emitted] main | |
[0] ./main.js 33 {0} [built] |
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
module.exports = function(msg) { | |
document.write("[print] " + msg); | |
}; |
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
var print = require("./print"); | |
print("Hello 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
$ webpack main.js bundle.js | |
Hash: 16b1755528d260b71262 | |
Version: webpack 1.4.15 | |
Time: 29ms | |
Asset Size Chunks Chunk Names | |
bundle.js 1694 0 [emitted] main | |
[0] ./main.js 56 {0} [built] | |
[1] ./print.js 59 {0} [built] |
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
npm install vue --save |
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
var Vue = require('vue'); | |
var demo = new Vue({ | |
el: '#demo', | |
data: { | |
message: 'Hello Vue.js!' | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment