Coder Social home page Coder Social logo

sable-virt / frontplate-cli Goto Github PK

View Code? Open in Web Editor NEW
25.0 6.0 8.0 493 KB

フロントエンドビルドCLI

Home Page: https://www.npmjs.com/package/frontplate-cli

JavaScript 97.35% HTML 2.65%
cli frontend webpack eslint babel ejs sass scss htmlhint

frontplate-cli's People

Contributors

i78s avatar kobayash avatar sable-virt avatar sundaycrafts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

frontplate-cli's Issues

環境によってjpgの圧縮がエラーになる

⠼ Generating StyleGuide...Error: Error in file: src/images/hero3.jpg

dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
  Referenced from: /Users/.../.nvm/versions/node/v5.6.0/lib/node_modules/frontplate-cli/node_modules/mozjpeg/vendor/cjpeg
  Reason: image not found

✖ [build] image

src/images/配下に、任意のディレクトリ階層で画像を置き、その階層構造のままpublic配下に出力したい

デフォルトだとこういう構造のところ、

├── public
│     ├── assets
│     │     └── images
│     │           ├── frontainer.png
│     │           └── icon.png
│         
├── src
│     ├── images
│     │     ├── frontainer.png
│     │     └── icon.png

下記のようにディレクトリ階層を保ったまま、public配下に出力する方法はありますでしょうか?

├── public
│     ├── assets
│     │     └── images
│     │           ├── common
│     │           │     └── frontainer.png
│     │           └── icon.png
│         
├── src
│     ├── images
│     │     ├── common
│     │     │      └── frontainer.png
│     │     └── icon.png

image.config.jsを下記のように直してみたのですが、publicにはimages直下に画像が出力されてしまいまして。。

module.exports = {
    src: 'src/images/**/*.{gif,jpg,png}',  // 読み込むイメージ
    dest: core.basePath + '/assets/images'        // 出力先
};

frpをグローバルにインストールした後、npm -g listするとエラーが出ている

以前のfrontplate-cliを npm uninstall -g frontplate-cli で削除し、[email protected] を新規にインストールしたところ、以下のエラーが出ていました。

$ npm i frontplate-cli -g
$ npm -g list --depth=0
/Users/user/.nvm/versions/node/v6.6.0/lib
├── [email protected]
└── [email protected]

npm ERR! extraneous: [email protected] /Users/user/.nvm/versions/node/v6.6.0/lib/node_modules/frontplate-cli/node_modules/add-stream
npm ERR! extraneous: [email protected] /Users/user/.nvm/versions/node/v6.6.0/lib/node_modules/frontplate-cli/node_modules/browser-stdout
npm ERR! extraneous: [email protected] /Users/user/.nvm/versions/node/v6.6.0/lib/node_modules/frontplate-cli/node_modules/conventional-changelog
npm ERR! extraneous: [email protected] /Users/user/.nvm/versions/node/v6.6.0/lib/node_modules/frontplate-cli/node_modules/define-properties
npm ERR! extraneous: [email protected] /Users/user/.nvm/versions/node/v6.6.0/lib/node_modules/frontplate-cli/node_modules/diff
npm ERR! extraneous: [email protected] /Users/user/.nvm/versions/node/v6.6.0/lib/node_modules/frontplate-cli/node_modules/empower
npm ERR! extraneous: [email protected] /Users/user/.nvm/versions/node/v6.6.0/lib/node_modules/frontplate-cli/node_modules/espower-loader
npm ERR! extraneous: [email protected] /Users/user/.nvm/versions/node/v6.6.0/lib/node_modules/frontplate-cli/node_modules/growl
npm ERR! extraneous: [email protected] /Users/user/.nvm/versions/node/v6.6.0/lib/node_modules/frontplate-cli/node_modules/lodash.create
npm ERR! extraneous: [email protected] /Users/user/.nvm/versions/node/v6.6.0/lib/node_modules/frontplate-cli/node_modules/power-assert-formatter
npm ERR! extraneous: [email protected] /Users/user/.nvm/versions/node/v6.6.0/lib/node_modules/frontplate-cli/node_modules/universal-deep-strict-equal

(v2.0.3) `frp serve` すると `Cannot read property 'concat' of undefined` となり失敗する

402ce1f が起因しているようです。
lib/tasks/script.js の L20のconcatがないと言われます。

以下のように部分的に巻き戻すと問題は起きなくなりました。

    //…
    config = merge(config, {
        resolve: {
            modules: [
                path.join(process.cwd(),'node_modules'),
            ]
        },
        resolveLoader: {
            modules: [
                path.join(process.cwd(),'node_modules'),
            ]
        },
    });

    if (process.env.NODE_PATH) {
        let paths = process.env.NODE_PATH.split(path.delimiter);
        config.resolve.modules = config.resolve.modules.concat(paths);
        config.resolveLoader.modules = config.resolveLoader.modules.concat(paths);
    }
    //…

webpackのjs optimizeがモジュールを壊すことがある

v2.1.2において frp build --production をした時に実行されるjsの最適化が、度々既存のモジュールを壊してしまうようです。

sample repogitory(uglifyしているのがgccだと思っていたのでリポジトリ名がそのようになっています):
https://github.com/sundaycrafts/gcc-too-agressive

問題の発生するコード
https://github.com/sundaycrafts/gcc-too-agressive/blob/master/src/js/app.js

問題が発生するモジュール

https://github.com/typekit/webfontloader (v1.6.27)

プロダクションビルドした時に発生するエラー

app.js:1 Uncaught TypeError: a.default.load is not a function()
// webFont.load(option) が正常に動作しておらず、このコードが実行される時点でa.defaultは空オブジェクトになっている

独自に作成したディレクトリをコピーさせたい(configディレクトリが自動的に作成されない)

やりたいこと

project_root/src/fontsproject_root/public/assets/fonts にコピーしたい。

症状

以下のコマンドを実行しました。

npm i frontplate-cli -g
mkdir myapp
cd myapp
frp create dev

この時点でREADMEの「想定される構成」にあるような、configディレクトリが生成されなかったため、設定を変更することができませんでした。

環境

  • OS X 10.11.6(El Capitan)
  • node v6.6.0 / npm 3.10.3

※nodeのバージョン管理としてnvmを使用

EJSビルドのスキップオプションが欲しい

TL;DR

configで

html: {
    skipIf: production // boolean; set this true to skip EJS build
}

とかやりたいです

達成したいこと

  • configでproduction時にEJSをビルドするか否かを指定したい

ユースケース

  • PHPアプリケーション向けに使用する場合など
  • EJSは単にコーディング成果物の検証用として出力し、本番ではEJSビルドが不要なケース
  • 本番ではEJSビルドをスキップしたい

何卒よろしくお願いいたします。

EJSのsource pathが変更されたことによる互換性問題とその一時的対策

概要

Frontplate CLIのアップデート後、EJSのビルド先ディレクトリが書き換わってしまいました。これにより既存プロジェクトのビルド時に「出力先が変わったのでパスの参照が崩れた」といった問題が発生しております。

ソースファイルが /src/view/index.ejs の場合の出力先の違いの例:

  • 変更: /public/index.html
  • 変更: /public/view/index.html

原因

コミット 51f68e9 によりEJSの読み込みパスが変更されため、ビルド時に view/ ディレクトリの構造ごと出力されるようになりました。

影響を受けるバージョン

v2.0.8 以降

既存プロジェクトに対する暫定的な対策

各プロジェクトの frp.config.js で読み込みパスを上書きすることでとりあえず元通り動くようになります。

'use strict';
module.exports = function(production) {
    return {
		// --- ここから追加 ---
		html: {
			src: `src/view/**/*.ejs`
		}
		// --- ここまで ---
    }
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.