From 491351c937af59fc2cbc54ee37c3fa5ec448ab68 Mon Sep 17 00:00:00 2001 From: Dominic Elm Date: Thu, 9 Dec 2021 18:43:52 +0100 Subject: [PATCH] fix: export assets in package.json --- README.md | 29 ++++++++---------------- projects/ngx-drag-to-select/package.json | 10 +++++++- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index dbbe91e..d56303d 100644 --- a/README.md +++ b/README.md @@ -75,31 +75,22 @@ The first step is to add the CSS and for that you have two options. Either you u Copy `ngx-drag-to-select.css` to your project and add it as a `style` tag to your `index.html`. -If you are using sass you can import the css as follows: +It's not recommended, and not supported, to load the CSS in your SCSS files. Instead, if you don't need to customize +the styles, and you're using the [Angular CLI](https://github.com/angular/angular-cli) you can add it to your `angular.json`: -```scss -@import '~ngx-drag-to-select/ngx-drag-to-select.css'; -``` - -If you are using the [Angular CLI](https://github.com/angular/angular-cli) you can add it to your `angular.json`: - -```json +```diff "styles": [ - { - "input": "src/styles.scss" - }, - { - "input": "node_modules/ngx-drag-to-select/ngx-drag-to-select.css" - } + "src/styles.scss", ++ "node_modules/ngx-drag-to-select/ngx-drag-to-select.css" ] ``` -**Using the sass package** +**Using Sass** -If you're using sass you can simply import the sass package. This allows you to [override the default variables](#overriding-sass-variables) to customize the library to your needs. +If you're using Sass you can simply import `ngx-drag-to-select` into `src/styles.scss`. This allows you to [override the default variables](#overriding-sass-variables) to customize the library to your needs. ```scss -@import '~ngx-drag-to-select/scss/ngx-drag-to-select'; +@import 'ngx-drag-to-select'; ``` ### Adding the module @@ -107,7 +98,7 @@ If you're using sass you can simply import the sass package. This allows you to In your `AppModule` import `DragToSelectModule` from `ngx-drag-to-select` and add it to the module imports: ```ts -import { DragToSelectModule } from 'ngx-drag-to-select'; +import { value DragToSelectModule } from 'ngx-drag-to-select'; @NgModule({ imports: [DragToSelectModule.forRoot()], @@ -198,7 +189,7 @@ You can override these options by passing a configuration object to `forRoot()`. Here's an example: ```ts -import { DragToSelectModule } from 'ngx-drag-to-select'; +import { value DragToSelectModule } from 'ngx-drag-to-select'; @NgModule({ imports: [ diff --git a/projects/ngx-drag-to-select/package.json b/projects/ngx-drag-to-select/package.json index ab831f0..2efa8f8 100644 --- a/projects/ngx-drag-to-select/package.json +++ b/projects/ngx-drag-to-select/package.json @@ -1,6 +1,6 @@ { "name": "ngx-drag-to-select", - "version": "5.0.0", + "version": "5.0.1", "description": "A lightweight, fast, configurable and reactive drag-to-select component for Angular 8 and beyond", "sideEffects": false, "peerDependencies": { @@ -8,6 +8,14 @@ "@angular/common": ">=8.0.0", "rxjs": ">=6.4.0" }, + "exports": { + ".": { + "sass": "./scss/ngx-drag-to-select.scss" + }, + "./ngx-drag-to-select.css": { + "style": "./ngx-drag-to-select.css" + } + }, "repository": { "type": "git", "url": "git+https://github.com/d3lm/ngx-drag-to-select.git"