yarnpkg

Webpack not copying css into dist

白昼怎懂夜的黑 提交于 2019-12-10 11:46:57
问题 I have the following css files: <link rel="stylesheet" href="style/select.css"> <link rel="stylesheet" href="style/site.css"> and the following webpack config var path = require("path"); module.exports = { entry: { app: './src/index.js' }, output: { path: path.resolve(__dirname + '/dist'), filename: '[name].js', }, module: { rules: [ { test: /\.(css|scss)$/, use: [ 'style-loader', 'css-loader', ] }, { test: /\.html$/, exclude: /node_modules/, loader: 'file-loader?name=[name].[ext]', }, { test

Rails with bootstrap installed via yarn can't find fonts

痞子三分冷 提交于 2019-12-10 11:12:47
问题 I have a Rails 5 app with Bootstrap which I installed with yarn. I did the following: yarn add bootstrap bootstrap@^3.3.7: version "3.3.7" resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-3.3.7.tgz#5a389394549f23330875a3b150656574f8a9eb71" on application.css *= require bootstrap/dist/css/bootstrap on application.js //= require bootstrap/dist/js/bootstrap //= require rails-ujs //= require @fnando/sparkline/dist/sparkline //= require_tree . on assets.rb Rails.application.config

Yarn global installs to current directory

≡放荡痞女 提交于 2019-12-10 11:09:53
问题 I am trying to get React Native working on my Linux machine. In order to get the cli running I have run: $ yarn global add react-native-cli and see: yarn global v0.16.1 warning No license field [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... success Installed react-native-cli@1.0.0 with binaries: - react-native Done in 1.70s. Everything installs just fine, but when I attempt to create a new React Native project, I get: $

What does yarn --prefer-offline do?

久未见 提交于 2019-12-09 17:19:29
问题 I assume when I install npm package say react for the first time with yarn add react this will save react file in local cache. I found .yarn-cache to contain many files. I assume it is yarn local cache folder so that when I install react again in the future, it will be installed from local cache, no?? If I need to install react again in the future, should I simply write yarn add react or yarn add react --prefer-offline ? 回答1: My understanding is that by default, yarn will always try to

sync yarn.lock back into package.json and lock

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-09 05:25:20
问题 I have package.json and yarn.lock files. yarn.lock has versions locked in, I would like to sync, and lock(without the ^) all the versions in yarn.lock, back into package.json. is there any easy way to do that? in the end I would like to not have "^" in my package.json at all as it leads to too many troubles, and I would like to upgrade packages specificly and not unknowingly when I run a fresh yarn install. is there any tool or way to quickly replace the versions in package.json with those

When to use Yarn over NPM? What are the differences?

谁都会走 提交于 2019-12-09 04:03:43
问题 What are the differences between Yarn and NPM? At the time of writing this question I can only find some articles on the Internet showing what's the Yarn equvalent of an NPM command like this. Do they have the same functionalities (I know Yarn does local caching and looks like you only need to download a package once) but other than this is there any benefits for moving from NPM to Yarn? 回答1: UPDATE: March 2018 (bit late...) Since version 5, npm generates a 'lockfile' called package-lock.json

Pass command line — argument to child script in Yarn

跟風遠走 提交于 2019-12-08 19:04:10
问题 I have a package.json that looks similar to this: "scripts": { "dev": "cross-env BABEL_ENV=client webpack --config webpack/client.development.js && yarn dev:stub-server | cross-env BABEL_ENV=server babel-node src/server/server.js", "dev:stub-server": "./node_modules/.bin/robohydra ./stubs/robohydra-config.json -p 3100" } I added some logic in the code to change the way the dev:stub-server is configured depending on a command line argument. So, whenever I run the following I get what I expect:

Pass arguments to “node” executable when running “yarn run”

此生再无相见时 提交于 2019-12-08 16:51:13
问题 node can be started with various options. Especially interesting is the --inspect flag: node --inspect node_modules/.bin/jest some.spec.js Is it possible to pass the --inspect flag somehow to yarn run ? For example: yarn run test --inspect some.spec.js There is a similar question for npm run , where it seems to be not possible. 回答1: I don't know that yarn run ... supports passing arguments to NodeJS, however, there are a couple of other options. You can use the NODE_OPTIONS environment

How to sync `yarn.lock` with `package.json`?

时光总嘲笑我的痴心妄想 提交于 2019-12-08 14:31:50
问题 I installed a package with yarn add --dev , run its setup process and during it, the package installed several other packages and added those to package.json (in devDependencies ), I assume with npm . Great, but now my yarn.lock is out of sync. What is the correct, non-manual way of syncing yarn.lock to the current state of package.json ? Edit: yarn check shows the missing packages as: error Lockfile does not contain pattern: <package>@<version> But it doesn't add them. 回答1: Run yarn install

Webpack: compile folder but keep separate files?

烈酒焚心 提交于 2019-12-08 10:42:46
问题 I have Webpack config that compiles nunjuck files into html files. However, I have to specify every single file input and output manually. I can't figure out how to 1) read all files in given folder AND 2) output separate compiled files into another folder, like this: src/file1.njk -> dist/file1.html src/file2.njk -> dist/file2.html ... this is my config file: const path = require("path"); var HtmlWebpackPlugin = require("html-webpack-plugin"); var glob_entries = require("webpack-glob-folder