Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PhoneGap/CordovaとWebpackで作るハイブリッドアプリ開発環境

puku0x
March 15, 2017

 PhoneGap/CordovaとWebpackで作るハイブリッドアプリ開発環境

puku0x

March 15, 2017
Tweet

More Decks by puku0x

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • ৽෱ ٓါ ʢShinpuku Noriyukiʣ • גࣜձࣾϕʔλιϑτ ΤϯδχΞ •

    झຯɾಛٕɿϓϩάϥϛϯά
 https://github.com/puku0x
  2. ೖग़ྗઃఆ const webpack = require('webpack'); module.exports = (env) => {

    return { entry: { app: __dirname + '/src/js/app.js' }, output: { path: __dirname + '/www/assets', filename: '[name].bundle.js', }, }}; TSD͔Β XXXBTTFUT΁
  3. ϩʔμઃఆʢES2015ʣ const webpack = require('webpack'); module.exports = (env) => {

    return { : module: { rules: [{ test: /\.js$/, exclude: /(node_modules|bower_components)/, use: ['babel-loader'] }] } }; }; Yܥ͸zVTFz
 MPBEFS͸লུෆՄ
  4. Babelઃఆ { "presets": [ [ “es2015", {"modules": false} ] ],

    "plugins": [ "angularjs-annotate" ] } YܥͰ"OHVMBS+4
 Λ࢖͏ͱ͖༻
  5. ϩʔμઃఆʢPostCSSʣ const webpack = require('webpack'); module.exports = (env) => {

    return { : module: { rules: [{ test: /\.(css|scss)$/, use: ['style-loader', 'css-loader', 'postcss-loader'] }] } }; };
  6. ϑΝΠϧ؂ࢹ "scripts": { "webpack": "webpack —-watch", "serve": "phonegap serve", "start":

    "npm run webpack & npm run serve" } $ npm start Windows؀ڥͰ͸concurrently͕ඞཁ͔΋
  7. ׬੒ʂ /src /www Ϗϧυ มߋݕ஌ มߋݕ஌ σϓϩΠ ES2015, Sass ES5,

    CSS3 https://github.com/puku0x/angularjs-onsenui2-webpack2