Skip to content

Commit 0e553ea

Browse files
committedJan 8, 2018
Drop babel and Node 7.5 and lower
1 parent 8085be3 commit 0e553ea

File tree

4 files changed

+13
-33
lines changed

4 files changed

+13
-33
lines changed
 

‎index.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import postcss from 'postcss';
2-
import path from 'path';
3-
import promisify from 'es6-promisify';
4-
import { CachedInputFileSystem, NodeJsInputFileSystem, ResolverFactory } from 'enhanced-resolve';
5-
import { replaceSymbols, replaceValueSymbols } from 'icss-utils';
1+
const postcss = require('postcss');
2+
const path = require('path');
3+
const promisify = require('es6-promisify');
4+
const { CachedInputFileSystem, NodeJsInputFileSystem, ResolverFactory } = require('enhanced-resolve');
5+
const { replaceSymbols, replaceValueSymbols } = require('icss-utils');
66

77
const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/;
88
const matchValueDefinition = /(?:\s+|^)([\w-]+)(:?\s+)(.+?)(\s*)$/g;
@@ -140,6 +140,6 @@ const factory = ({ fs = nodeFs, resolve: options = {} } = {}) => async (root, ro
140140

141141

142142
const plugin = postcss.plugin(PLUGIN, factory);
143-
module.exports = plugin; // support old good require
144-
export default plugin;
143+
module.exports = plugin;
144+
exports.default = plugin;
145145

‎package.json

+2-18
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88
"postcss-plugin",
99
"css-modules"
1010
],
11-
"main": "lib",
1211
"files": [
13-
"index.js",
14-
"lib"
12+
"index.js"
1513
],
1614
"author": "Eugene Datsky <eugene@datsky.ru>",
1715
"license": "ISC",
@@ -21,36 +19,22 @@
2119
},
2220
"homepage": "https://github.com/princed/postcss-modules-values-replace",
2321
"dependencies": {
24-
"@ava/babel-preset-stage-4": "^1.0.0",
2522
"enhanced-resolve": "^3.1.0",
2623
"es6-promisify": "^5.0.0",
2724
"icss-utils": "^3.0.1",
2825
"postcss": "^6.0.1"
2926
},
3027
"devDependencies": {
3128
"ava": "^0.24.0",
32-
"babel-cli": "^6.18.0",
33-
"babel-core": "^6.18.2",
34-
"babel-polyfill": "^6.16.0",
35-
"babel-register": "^6.22.0",
3629
"eslint": "^4.15.0",
3730
"eslint-config-airbnb-base": "^12.1.0",
3831
"eslint-plugin-import": "^2.5.0"
3932
},
4033
"scripts": {
41-
"build": "babel --out-dir lib index.js",
4234
"lint": "eslint *.js",
43-
"prepublish": "npm run lint && npm run build",
35+
"prepublish": "npm test",
4436
"test": "npm run lint && ava"
4537
},
46-
"ava": {
47-
"require": "babel-register"
48-
},
49-
"babel": {
50-
"presets": [
51-
"@ava/stage-4"
52-
]
53-
},
5438
"eslintConfig": {
5539
"extends": "eslint-config-airbnb-base"
5640
}

‎test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* eslint-disable import/no-extraneous-dependencies */
22

3-
import postcss from 'postcss';
4-
import test from 'ava';
5-
import { resolve } from 'path';
3+
const postcss = require('postcss');
4+
const test = require('ava');
5+
const { resolve } = require('path');
66

7-
import plugin from './index';
7+
const plugin = require('.');
88

99
const parserOpts = {
1010
from: resolve(__dirname, 'fixtures/from.css'),

‎wallaby.js

-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,5 @@ module.exports = wallaby => ({
2020

2121
testFramework: 'ava',
2222

23-
setup() {
24-
require('babel-polyfill');
25-
},
26-
2723
debug: true,
2824
});

0 commit comments

Comments
 (0)
Please sign in to comment.