Skip to content

Commit 9fd47a6

Browse files
author
♥ David ♥
committed
new version
1 parent 299a99b commit 9fd47a6

38 files changed

+12559
-41
lines changed

.babelrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"presets": [
3+
[
4+
"env",
5+
{
6+
"targets": {
7+
"node": [
8+
"4.0.0"
9+
]
10+
}
11+
}
12+
]
13+
],
14+
"plugins": [
15+
"babel-plugin-add-module-exports"
16+
]
17+
}

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
indent_size = 4
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
max_line_length = 233
10+
11+
[*.{yml,yaml,json}]
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.md]
16+
trim_trailing_whitespace = false

.eslintrc.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = {
2+
root: true,
3+
parser: "babel-eslint",
4+
plugins: [
5+
"import",
6+
"prettier"
7+
],
8+
"extends": [
9+
"webpack",
10+
"plugin:import/errors",
11+
"plugin:import/warnings",
12+
"eslint:recommended",
13+
"plugin:prettier/recommended"
14+
],
15+
env: {
16+
node: true,
17+
es6: true,
18+
jest: true
19+
},
20+
parserOptions: {
21+
ecmaVersion: 2017
22+
},
23+
rules:{
24+
'no-unused-vars': 'warn'
25+
}
26+
};

.gitignore

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,62 @@
1-
/node_modules/
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pid-s
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (http://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# Typescript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+
60+
# my
61+
lib/
62+
.idea/

.lintstagedrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"./**/*.js": [
3+
"prettier",
4+
"eslint --fix",
5+
"git add"
6+
],
7+
"./**/*.css": [
8+
"prettier",
9+
"git add"
10+
]
11+
}

.nycrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"reporter": [
3+
"lcov",
4+
"text"
5+
],
6+
"tempDirectory": "./coverage"
7+
}

.travis.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
sudo: false
2+
language: node_js
3+
node_js:
4+
- "10"
5+
- "8"
6+
- "6"
7+
install:
8+
- yarn
9+
script:
10+
- yarn test
11+
12+
env:
13+
global:
14+
- CC_TEST_REPORTER_ID=ABC123
15+
16+
before_install:
17+
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.6.0
18+
- export PATH=$HOME/.yarn/bin:$PATH
19+
20+
before_script:
21+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
22+
- chmod +x ./cc-test-reporter
23+
- ./cc-test-reporter before-build
24+
after_script:
25+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
26+
27+
cache:
28+
yarn: true
29+
directories:
30+
- node_modules

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 David
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 126 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,126 @@
1-
1+
<div align="center">
2+
<img src="https://cdn.rawgit.com/jakubpawlowicz/clean-css/master/logo.v2.svg" alt="clean-css logo" width="500"/>
3+
<br>
4+
<a href="https://github.com/webpack/webpack">
5+
<img width="200" height="200"
6+
src="https://webpack.js.org/assets/icon-square-big.svg">
7+
</a>
8+
</div>
9+
10+
A [clean-css](https://github.com/jakubpawlowicz/clean-css) loader for [webpack](https://github.com/webpack/webpack).
11+
12+
# clean-css-loader
13+
14+
[![npm](https://img.shields.io/npm/v/clean-css-loader.svg)](https://www.npmjs.com/package/clean-css-loader)
15+
[![npm clean-css-loader](https://img.shields.io/npm/dm/clean-css-loader.svg)](https://www.npmjs.com/package/clean-css-loader)
16+
[![Build Status](https://travis-ci.org/retyui/clean-css-loader.svg?branch=master)](https://travis-ci.org/retyui/clean-css-loader)
17+
[![Greenkeeper badge](https://badges.greenkeeper.io/retyui/clean-css-loader.svg)](https://greenkeeper.io/)
18+
19+
## Install
20+
21+
```bash
22+
# for webpack@4 or 3 or 2
23+
yarn add -D clean-css-loader
24+
25+
# for webpack@1.x
26+
yarn add -D clean-css-loader@0.14.0
27+
```
28+
29+
## Usage
30+
31+
Use the loader either via your webpack config, CLI or inline.
32+
33+
### Via webpack config (recommended)
34+
35+
**webpack.config.js**
36+
37+
```js
38+
const production = false;
39+
40+
const cssUseList = ["style-loader", "css-loader"];
41+
42+
if (production) {
43+
cssUseList.push("clean-css-loader");
44+
// or with options
45+
cssUseList.push({
46+
loader: "clean-css-loader",
47+
options: {
48+
compatibility: "ie9",
49+
level: 2,
50+
inline: ["remote"]
51+
}
52+
});
53+
}
54+
55+
module.exports = {
56+
module: {
57+
rules: [
58+
{
59+
test: /\.css$/,
60+
use: cssUseList
61+
}
62+
]
63+
}
64+
};
65+
```
66+
67+
**In your application**
68+
69+
```js
70+
import cssMin from "style.css";
71+
```
72+
73+
### CLI
74+
75+
```bash
76+
webpack --module-bind 'css=style-loader!css-loader!clean-css-loader'
77+
```
78+
79+
**In your application**
80+
81+
```js
82+
import cssMin from "style.css";
83+
```
84+
85+
### Inline
86+
87+
**In your application**
88+
89+
```js
90+
import cssMin from "style-loader!css-loader!clean-css-loader!./style.css";
91+
```
92+
93+
## Options
94+
95+
### `skipWarn` default: `false`
96+
97+
This option disable output warnings
98+
99+
More option: [https://github.com/jakubpawlowicz/clean-css#constructor-options](https://github.com/jakubpawlowicz/clean-css#constructor-options)
100+
101+
## Webpack 1.x
102+
103+
**Example config (for webpack 1.x):**
104+
105+
```js
106+
module.exports = {
107+
module: {
108+
loaders: [
109+
{
110+
test: /\.css$/,
111+
loader: "css!clean-css"
112+
},
113+
{
114+
test: /\.styl$/,
115+
loader: "css!clean-css!stylus?reslve url"
116+
}
117+
//...
118+
],
119+
// Example Set options (Key "clean-css" or cleancss or CleanCSS):
120+
"clean-css": {
121+
debug: true,
122+
mediaMerging: true
123+
}
124+
}
125+
};
126+
```

appveyor.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
image: Visual Studio 2017
2+
init:
3+
- git config --global core.autocrlf input
4+
5+
environment:
6+
matrix:
7+
# - nodejs_version: 10
8+
# - nodejs_version: 8
9+
- nodejs_version: 6
10+
11+
# Finish on first failed build
12+
matrix:
13+
fast_finish: true
14+
15+
platform:
16+
- x64
17+
18+
branches:
19+
only:
20+
- master
21+
22+
# Disable Visual Studio build and deploy
23+
build: off
24+
deploy: off
25+
26+
install:
27+
- ps: Install-Product node $env:nodejs_version $env:platform
28+
- yarn install
29+
30+
test_script:
31+
- node --version
32+
- yarn --version
33+
- yarn test
34+
35+
cache:
36+
- node_modules
37+
- "%LOCALAPPDATA%/Yarn"

index.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
coverageReporters: ["json"]
3+
};

0 commit comments

Comments
 (0)