作者:Gemini强强Gemini | 来源:互联网 | 2023-05-18 06:32
Ihaveinstalledthenode-sass-middlewaremoduleonmyexpressapplication,butimnotgettingthat
I have installed the node-sass-middleware
module on my express application, but i'm not getting that working, just because the middleware is reading an incorrect source, when i debug the console log is:
我已经在我的快速应用程序上安装了node-sass-middleware模块,但是我没有这样做,只是因为中间件正在读取不正确的源,当我调试控制台日志时:
GET / 200 558.983 ms - 4651
source: /home/karim/Snippets/my-financial/public/stylesheets/sass/stylesheets/main.sass
dest: /home/karim/Snippets/my-financial/public/stylesheets/stylesheets/main.css
read: /home/karim/Snippets/my-financial/public/stylesheets/stylesheets/main.css
which both directories are wrong, why the middleware is adding the string stylesheets/
between the source
/dest
(..public/stylesheets/sass/
) and the .sass file
/.css file
(main.sass
and main.css
)?
哪两个目录都错了,为什么中间件在source / dest(..public / stylesheets / sass /)和.sass文件/ .css文件(main.sass和main.css)之间添加字符串样式表?
I have this configuration inside my app.js
:
我在app.js中有这个配置:
var sassMiddleware = require('node-sass-middleware');
...
...
var app = express();
app.use(sassMiddleware({
src: path.join(__dirname, 'public/stylesheets/sass'),
dest: path.join(__dirname, 'public/stylesheets'),
debug: true,
indentedSyntax: true,
outputStyle: 'compressed'
}));
Obviously this is not compiling anything, becuase the directories are wrong. Inside the ..public/stylesheets/sass/
folder i just have one file, main.sass
which i want to compile and move the result outside the sass/
folder, i mean at ..public/stylesheets/
.
显然这不是编译任何东西,因为目录是错误的。在.public / stylesheets / sass /文件夹里面我只有一个文件,main.sass,我想编译并将结果移到sass /文件夹之外,我的意思是..public / stylesheets /。
1 个解决方案