Slide 1

Slide 1 text

Vue.js `vue build` DIST.14 2017-02-17 @kazupon

Slide 2

Slide 2 text

Who are you ?

Slide 3

Slide 3 text

Vue.js Core Team member https://github.com/kazupon

Slide 4

Slide 4 text

Introduction

Slide 5

Slide 5 text

JavaScript Fatigue in Front-end https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f#.v7jsb7mjj

Slide 6

Slide 6 text

The solution of Vue • vue-cli • Official templates npm install -g vue-cli vue-cli init webpack-simple-2.0 my-app cd my-app npm install npm run dev

Slide 7

Slide 7 text

So, Web App setup Happy!!


Slide 8

Slide 8 text

But, About for prototyping … • Tools management … • Bundler configuration … • Template customizing … “We'd like to fold that functionality into vue-cli as vue build with a sharper focus on prototyping experience.” https://github.com/vuejs/vue-cli/issues/173

Slide 9

Slide 9 text

Damn, We are still fatiguing !!

Slide 10

Slide 10 text

Today Speak:
 vue-cli New command
 `vue build` ✨

Slide 11

Slide 11 text

`vue build` • A zero-configuration development setup, install once and build everywhere. • Support from v2.8.0 • Webpack based implementation • built-in some loaders: file, url, css, postcss, babel … • ES2015 with babel • dev-server with express

Slide 12

Slide 12 text

`vue build` Implementor

Slide 13

Slide 13 text

Implementor • Vue.js core team member https://github.com/egoist

Slide 14

Slide 14 text

Refined webpack development experience https://github.com/egoist/vbuild

Slide 15

Slide 15 text

Love call ❤ https://github.com/egoist/vbuild/issues/9

Slide 16

Slide 16 text

vbuild ➡ `vue build` porting !!

Slide 17

Slide 17 text

`vue build` Features ⭐

Slide 18

Slide 18 text

Basic vue build index.js
 Compiled successfully in 1793ms > Open http://localhost:4000

Slide 19

Slide 19 text

Build for production vue build index.js --prod > Creating an optimized production build: Hash: 56152bbe124d3f8999bc Version: webpack 2.2.1 Time: 2890ms Asset Size Chunks Chunk Names client.6832bedc.js 52.5 kB 0 [emitted] client client.6832bedc.js.map 426 kB 0 [emitted] client index.html 260 bytes [emitted] SUCCESS Compiled successfully.

Slide 20

Slide 20 text

Build for distribution component vue build comp.js --prod --lib Comp > Creating an optimized production build: Hash: 578553dd919e3ba54abf Version: webpack 2.2.1 Time: 562ms Asset Size Chunks Chunk Names comp.js 922 bytes 0 [emitted] client comp.js.map 8.37 kB 0 [emitted] client SUCCESS Compiled successfully.

Slide 21

Slide 21 text

Watch mode vue build index.js --watch
 Compiled successfully in 1793ms > Open http://localhost:4000 hello world !! hello vue.js !! Edit Update with Hot reloading !!

Slide 22

Slide 22 text

Single File Components vue build hello.vue
 Compiled successfully in 1793ms > Open http://localhost:4000

Slide 23

Slide 23 text

Configuration vue init webpack project1 cd project1 yarn vue build src/main.js --prod --webpack build/webpack.prod.conf.js > Using .babelrc in current working directory > Using webpack config file at ~/path/to/project1/build/webpack.prod.conf.js > Creating an optimized production build: Hash: 39c01c24ee5fd0c92ab6 Version: webpack 2.2.1 Time: 8086ms Asset Size Chunks Chunk Names static/js/client.f8a1e4f147fedafd6460.js.map 18 kB 0, 1, 3 [emitted] client static/logo.94d14d6a.png 9.17 kB [emitted] static/js/app.7cf57349194a8d0aefc2.js 2.6 kB 1, 3 [emitted] app static/js/vendor.4c0310dd0f2fc9218a18.js 76.4 kB 2, 3 [emitted] vendor static/js/manifest.da0f37b4fda13d9d3845.js 1.52 kB 3 [emitted] manifest static/css/client.e7a9982cfb5f83ec00c5653d0d57f219.css 434 bytes 0, 1, 3 [emitted] client static/css/app.e7a9982cfb5f83ec00c5653d0d57f219.css 431 bytes 1, 3 [emitted] app static/js/client.f8a1e4f147fedafd6460.js 2.64 kB 0, 1, 3 [emitted] client static/css/client.e7a9982cfb5f83ec00c5653d0d57f219.css.map 949 bytes 0, 1, 3 [emitted] client static/js/app.7cf57349194a8d0aefc2.js.map 17.8 kB 1, 3 [emitted] app static/css/app.e7a9982cfb5f83ec00c5653d0d57f219.css.map 956 bytes 1, 3 [emitted] app static/js/vendor.4c0310dd0f2fc9218a18.js.map 608 kB 2, 3 [emitted] vendor static/js/manifest.da0f37b4fda13d9d3845.js.map 14.2 kB 3 [emitted] manifest index.html 619 bytes [emitted] SUCCESS Compiled successfully.

Slide 24

Slide 24 text

DEMO

Slide 25

Slide 25 text

Conclusion

Slide 26

Slide 26 text

Conclusion • `vue build` is zero-configuration building command for prototyping • Use custom configuration feature, you can also build the your App!!

Slide 27

Slide 27 text

Reference • documentation
 https://github.com/vuejs/vue-cli/blob/master/docs/build.md

Slide 28

Slide 28 text

One more thing …

Slide 29

Slide 29 text

Vue.js community for Japanese • You can join via Vue.js official site
 http://jp.vuejs.org
 


Slide 30

Slide 30 text

Vue.je v-meetup=“#3” • 2017/03/16 19:00ʙ22:00 https://vuejs-meetup.connpass.com/event/48462/

Slide 31

Slide 31 text

Thanks!