New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-miniprogram-path-alias

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-miniprogram-path-alias

小程序路径别名

  • 0.1.5
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

gulp-miniprogram-path-alias

小程序 依赖引用路径别名

Install

npm install --save-dev gulp-miniprogram-path-alias

Usage

.
├── src # 开发目录
│   └── common #公共功能模块,管理功能功能模块,与业务交互有一定相关的模块
└── gulpfile.js # 别名配置

在你的 gulpfile.js 添加一个 task

var alias = require('gulp-miniprogram-path-alias');
var path = require('path');

function _join(dirname) {
    return path.join(__dirname, '..', 'src', dirname);
}
var aliasConfig = {
    common: _join('common')
};

gulp.task('alias', function () {
    gulp.src('src/**/*.{js,wxml,wxss}')
        .pipe(alias(aliasConfig))
        .pipe(gulp.dest('/build'));
});

*.js :

var common = require('common');
// or
import common from 'common';

*.wxml :

<import src="common/test.wxml" />

*.wxss :

@import "common/style.wxss";

Keywords

FAQs

Package last updated on 01 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc