package.json

What is the “module” package.json field for?

一个人想着一个人 提交于 2019-11-27 18:14:37
I've seen some npm packages ( vue for example ) have a pkg.module field in their package.json. Is "module" an official npm property or is this a convention of some kind? Is there documentation for this somewhere? What's it for? esnext path? Unbundled module path? Is "module" an official npm property or is this a convention of some kind? It's a proposal , but likely to be supported due to de facto usage. Is there documentation for this somewhere? There is, in fact, and it can be found right here and later removed here . What's it for? ES6 Module Interoperability in Node. Additional discussion

Pass command line args to npm scripts in package.json

删除回忆录丶 提交于 2019-11-27 14:28:22
I have the below scripts in my package.json: "scripts": { "vumper": "node node_modules/vumper/index.js", "format": "prettier --single-quote -width=80 --write package.json" }, The 'vumper' package takes in a command line argument (such as 'dv'). What I would like to be able to do is have a command that runs both of these in succession. Essentially, I would like to be able to run: npm run vumber dv and then npm run format but in one command, something like npm run my-build dv which would run both of the above commands, correctly accepting the command line argument 'dv' and passing it to the

How to specify the path of `package.json` to npm?

此生再无相见时 提交于 2019-11-27 13:24:28
问题 I use npm scripts to build my project. I'd like to be able to run the scripts from a different directory. That is, instead of doing the following: cd project; npm run build; cd .. ...I'd like to simply do something like: npm run build -config project/package.json; or npm run build -wd project; Is this possible? 回答1: Using --prefix worked for me: npm --prefix /path/to/project run build Where path/to/project is the directory where your package.json with build command defined. 来源: https:/

What is purpose of the property “private” in package.json?

孤人 提交于 2019-11-27 12:15:42
I'm learning node.js and express, I am wondering what is the property "private" in ./package.json file used for? ace Taken from this site, https://docs.npmjs.com/files/package.json#private private If you set "private": true in your package.json, then npm will refuse to publish it. This is a way to prevent accidental publication of private repositories. 来源: https://stackoverflow.com/questions/7314849/what-is-purpose-of-the-property-private-in-package-json

Build .exe file in .NET Core RC2

一个人想着一个人 提交于 2019-11-27 10:14:30
Every time I build a project using the new .NET Core RC2 templates I am not provided with a runnable . EXE file. If I hit F5 for debugging my console application it runs fine through the C:\Program Files\dotnet\dotnet.exe application. And if I use the dotnet run command in the folder, it runs fine as well. But I see no way to run the application without the .NET Core CLI tools. The contents of my bin\Debug\netcoreapp1.0\ folder looks like this: As you can see there is no . EXE file available. Just the dll. Am I overlooking something? Or is there something wrong with my project.json file? {

“unexpected token import” in Nodejs5 and babel?

限于喜欢 提交于 2019-11-27 06:07:59
In js file, i used import to instead of require import co from 'co'; And tried to run it directly by nodejs since it said import is 'shipping features' and support without any runtime flag ( https://nodejs.org/en/docs/es6/ ), but i got an error import co from 'co'; ^^^^^^ SyntaxError: Unexpected token import Then i tried to use babel npm install -g babel-core npm install -g babel-cli npm install babel-core //install to babel locally, is it necessary? and run by babel-node js.js still got same error, unexpected token import? How could I get rid of it? Laurence Bortfeld From the babel 6 Release

Field 'browser' doesn't contain a valid alias configuration

左心房为你撑大大i 提交于 2019-11-27 05:44:03
问题 I've started using webpack2 (to be precise, v2.3.2 ) and after re-creating my config I keep running into an issue I can't seem to solve I get (sorry in advance for ugly dump): ERROR in ./src/main.js Module not found: Error: Can't resolve 'components/DoISuportIt' in '[absolute path to my repo]/src' resolve 'components/DoISuportIt' in '[absolute path to my repo]/src' Parsed request is a module using description file: [absolute path to my repo]/package.json (relative path: ./src) Field 'browser'

What is the “module” package.json field for?

感情迁移 提交于 2019-11-27 05:18:50
问题 I've seen some npm packages (vue for example) have a pkg.module field in their package.json. Is "module" an official npm property or is this a convention of some kind? Is there documentation for this somewhere? What's it for? esnext path? Unbundled module path? 回答1: Is "module" an official npm property or is this a convention of some kind? It's a proposal, but likely to be supported due to de facto usage. Is there documentation for this somewhere? There is, in fact, and it can be found right

“unexpected token import” in Nodejs5 and babel?

不问归期 提交于 2019-11-27 03:58:45
问题 In js file, i used import to instead of require import co from 'co'; And tried to run it directly by nodejs since it said import is 'shipping features' and support without any runtime flag (https://nodejs.org/en/docs/es6/), but i got an error import co from 'co'; ^^^^^^ SyntaxError: Unexpected token import Then i tried to use babel npm install -g babel-core npm install -g babel-cli npm install babel-core //install to babel locally, is it necessary? and run by babel-node js.js still got same

“style” field in package.json

蹲街弑〆低调 提交于 2019-11-27 03:50:41
问题 I noticed that Bootstrap and Normalize.css both have a "style" field in their package.json. Why do they have this? If I had to guess, it's to allow users to import the defined stylesheet as easily as doing require('bootstrap') , but that doesn't seem to be the case. 回答1: From Techwraith's pull request that added it to Bootstrap: Many modules in npm are starting to expose their css entry files in their package.json files. This allows tools like npm-css, rework-npm, and npm-less to import