sable-virt / frontplate-cli Goto Github PK
View Code? Open in Web Editor NEWフロントエンドビルドCLI
Home Page: https://www.npmjs.com/package/frontplate-cli
フロントエンドビルドCLI
Home Page: https://www.npmjs.com/package/frontplate-cli
⠼ 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
デフォルトだとこういう構造のところ、
├── 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' // 出力先
};
以前の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
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);
}
//…
npm WARN deprecated [email protected]: Babel's CLI commands have been moved from the babel package to the babel-cli package
npm WARN deprecated [email protected]: Package renamed to phantomjs-prebuilt. Please update 'phantomjs' package references to 'phantomjs-prebuilt'
serveタスクのメモリ使用量が多い問題
WebPack2のメモリリークが影響している可能性もあるが、ポイントが絞れていないため調査が必要
https://github.com/webpack/webpack/labels/S3%3A%20Memory%20Leak
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は空オブジェクトになっている
project_root/src/fonts
を project_root/public/assets/fonts
にコピーしたい。
以下のコマンドを実行しました。
npm i frontplate-cli -g
mkdir myapp
cd myapp
frp create dev
この時点でREADMEの「想定される構成」にあるような、configディレクトリが生成されなかったため、設定を変更することができませんでした。
※nodeのバージョン管理としてnvmを使用
TASK_NAMEの一覧などを表示させる
frp create
は内部的にnpm install
しているが、yarn install
もサポートする
https://github.com/yarnpkg/yarn
configで
html: {
skipIf: production // boolean; set this true to skip EJS build
}
とかやりたいです
何卒よろしくお願いいたします。
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`
}
// --- ここまで ---
}
};
処理がexitしてしまってエラーメッセージが表示されていない
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.