npm

Import CSS from node_modules using Gulp-SASS

不打扰是莪最后的温柔 提交于 2021-02-06 10:43:07
问题 I want to import a CSS-file from my node_modules using SASS. @import 'normalize.css/normalize'; This is how my gulpfile.js handles my SASS: const gulp = require('gulp'), sass = require('gulp-sass'); gulp.task('sass', function () { return gulp.src(['source/assets/css/**.scss', '!source/assets/css/**/_*.[scss|sass']) .pipe(sass()) .pipe(gulp.dest('output/assets/css')); }); SASS compiler will not import the css from node_modules. Instead, this will throw an error. Error: File to import not found

Import CSS from node_modules using Gulp-SASS

感情迁移 提交于 2021-02-06 10:42:36
问题 I want to import a CSS-file from my node_modules using SASS. @import 'normalize.css/normalize'; This is how my gulpfile.js handles my SASS: const gulp = require('gulp'), sass = require('gulp-sass'); gulp.task('sass', function () { return gulp.src(['source/assets/css/**.scss', '!source/assets/css/**/_*.[scss|sass']) .pipe(sass()) .pipe(gulp.dest('output/assets/css')); }); SASS compiler will not import the css from node_modules. Instead, this will throw an error. Error: File to import not found

Is there any way to fix package-lock.json lockfileVersion so npm uses a specific format?

时光总嘲笑我的痴心妄想 提交于 2021-02-06 10:01:20
问题 If two different developers are using different versions of node (12/15) & npm (6/7) in a project that was originally created using a package-lock.json "lockfileVersion": 1 , when the developer using npm 7x installs new packages it seems that the package-lock.json is re-created using "lockfileVersion": 2 . This seems to cause issues for the developer using npm v6, as it tries to work with the lockfileVersion 2 , but it ends up producing new diffs. npm WARN read-shrinkwrap This version of npm

Is there any way to fix package-lock.json lockfileVersion so npm uses a specific format?

谁都会走 提交于 2021-02-06 10:01:08
问题 If two different developers are using different versions of node (12/15) & npm (6/7) in a project that was originally created using a package-lock.json "lockfileVersion": 1 , when the developer using npm 7x installs new packages it seems that the package-lock.json is re-created using "lockfileVersion": 2 . This seems to cause issues for the developer using npm v6, as it tries to work with the lockfileVersion 2 , but it ends up producing new diffs. npm WARN read-shrinkwrap This version of npm

Gitee图床+PicGo+Typora便捷在博客中使用图片

十年热恋 提交于 2021-02-06 09:30:40
## 为什么要使用图床 在hugo中,图片是以 /static 为基准目录的,例如,设baseUrl为 https://focksor.gitee.io/ ,图片文件存放位置是 static/img/gitee/123.jpg ,那么,编译完成后页面图片引用的地址就是 https://focksor.gitee.io/img/gitee/123.jpg ,则在Markdown要引用此图片应该用 ![图片说明](/img/gitee/123.jpg) ,但是这样带来的问题是,在写作的时候无法看到图片,要经过hugo编译之后才能看到文档图片,这样的写作显然是不友好的。 图床指存储图片的服务器,使用图床存储文档中的图片,那么在使用图片的时候只要写上图片所在的网络地址就好了,这样比较使用静态图片体验显然要好很多。下面介绍Gitee+PicGo的方法来使用gitee作为图床。 为什么需要PicGo 想象一下,使用markdown编写你的博客时,插入截图是什么流程:将截图保存到本地文件夹->将图片文件上传到网络服务器中->复制图片的网络地址->在markdown中输入 ![](图片的网络地址) ,这个过程无疑是很繁琐的,而且如果你图片一多,这种过程将会是魔鬼体验。 PicGo是一款免费的图床管理应用,支持拖拽上传,剪切板上传等方式。你可以用它快捷地将图片上传到图床并获得网络链接

webpack-dev-server not updating bundle when saving file

我怕爱的太早我们不能终老 提交于 2021-02-06 04:50:48
问题 I'm teaching myself webpack from scratch and I am trying to use the webpack-dev-server to live update the browser when I change a .js in my app file and show the changes. Say I have the following package.json { "name": "webpack-babel", "version": "1.0.0", "description": "", "main": "webpack.config.js", "scripts": { "serve": "webpack-dev-server --hot", "start": "webpack" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "babel-core": "^6.23.1", "babel-loader": "^6.3.2",

webpack-dev-server not updating bundle when saving file

女生的网名这么多〃 提交于 2021-02-06 04:50:21
问题 I'm teaching myself webpack from scratch and I am trying to use the webpack-dev-server to live update the browser when I change a .js in my app file and show the changes. Say I have the following package.json { "name": "webpack-babel", "version": "1.0.0", "description": "", "main": "webpack.config.js", "scripts": { "serve": "webpack-dev-server --hot", "start": "webpack" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "babel-core": "^6.23.1", "babel-loader": "^6.3.2",

webpack-dev-server not updating bundle when saving file

℡╲_俬逩灬. 提交于 2021-02-06 04:49:37
问题 I'm teaching myself webpack from scratch and I am trying to use the webpack-dev-server to live update the browser when I change a .js in my app file and show the changes. Say I have the following package.json { "name": "webpack-babel", "version": "1.0.0", "description": "", "main": "webpack.config.js", "scripts": { "serve": "webpack-dev-server --hot", "start": "webpack" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "babel-core": "^6.23.1", "babel-loader": "^6.3.2",

VUE引入jq bootstrap 之终极解决方案(测试)

吃可爱长大的小学妹 提交于 2021-02-06 01:22:52
初入VUE遇见的一些问题,在网上找了些方法,再根据自己的实际项目解决的问题写得此文,,希望对你有所帮助。 vue-cli快速构建项目以及引入boostrap、jq各种插件配置 vue-cli脚手架工具快速构建项目架构: 。。首先默认了有已经安装了node。。。 npm install -g vue-cli // 全局安装vue-cli vue init webpack cnm // 生成项目名为cnm的的项目模板,cnm自定义 npm install // 到cnm文件夹中打开命令窗口初始化安装依赖 此时文件夹目录应该是这样 然后输入npm run dev。。不出意外浏览器会自动弹出一个欢迎页面,如果不自动弹出就打开http://localhost:8080 到这里就可以在对应的文件中修改代码开发项目了。。。但是如果要引入一些插件或者框架怎么办呢? 引入jq: 输入 npm install jquery --save-dev 用npm下载jq依赖、 找到build文件夹下的webpack.base.conf.js文件打开,修改配置: 1、加入webpack对象: var webpack=require('webpack'); 2、在module.exports里面加入: plugins: [ new webpack.ProvidePlugin({ $:"jquery",

Is there a way to log the output of npm install command

落爺英雄遲暮 提交于 2021-02-05 14:49:52
问题 I ran npm install on a project and it gives a number of errors and warnings that I want to catch, but the output is too long and being cut off so I can't view the full list in the terminal. I tried redirect it to a file but the output is still being written to the terminal and I still get an output file which only list the dependency trees. I also tried to pipe it to less in linux but it still run through many screens until stopped for continue. I checked npm doc and it doesn't seem to have