ember-scoped-css 0.2.9 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,17 +1,15 @@
1
- const rollupEmberTemplateImportsPlugin = require('./src/rollup-ember-template-imports-plugin');
2
- const addonJsUnplugin = require('./src/addon-js-unplugin');
3
- const addonCssRollup = require('./src/addon-css-rollup');
4
- const addonHbsRollup = require('./src/addon-hbs-rollup');
5
- const appJsUnplugin = require('./src/app-js-unplugin');
6
- const appCssUnplugin = require('./src/app-css-unplugin');
7
- const appCssLoader = require('./src/app-css-loader');
8
- const appDependencyLoader = require('./src/app-dependency-loader');
9
- const appScopedcssWebpack = require('./src/app-scopedcss-webpack');
10
- const addonRewritecssRollup = require('./src/addon-rewritecss-rollup');
11
- const babelPluginScopedClass = require('./src/babel-plugin-scoped-class');
12
- const scopedClassModule = require('./src/scopedClass');
1
+ import rollupEmberTemplateImportsPlugin from './src/rollup-ember-template-imports-plugin.js';
2
+ import addonJsUnplugin from './src/addon-js-unplugin.js';
3
+ import addonCssRollup from './src/addon-css-rollup.js';
4
+ import addonHbsRollup from './src/addon-hbs-rollup.js';
5
+ import appJsUnplugin from './src/app-js-unplugin.js';
6
+ import appCssUnplugin from './src/app-css-unplugin.js';
7
+ import appCssLoader from './src/app-css-loader.js';
8
+ import appDependencyLoader from './src/app-dependency-loader.js';
9
+ import appScopedcssWebpack from './src/app-scopedcss-webpack.js';
10
+ import addonRewritecssRollup from './src/addon-rewritecss-rollup.js';
13
11
 
14
- module.exports = {
12
+ export {
15
13
  rollupEmberTemplateImportsPlugin,
16
14
  addonJsUnplugin,
17
15
  addonCssRollup,
@@ -22,6 +20,4 @@ module.exports = {
22
20
  appDependencyLoader,
23
21
  appScopedcssWebpack,
24
22
  addonRewritecssRollup,
25
- babelPluginScopedClass,
26
- 'test-helper': scopedClassModule,
27
23
  };
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "ember-scoped-css",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "",
5
- "type": "commonjs",
5
+ "type": "module",
6
6
  "main": "index.js",
7
+ "exports": {
8
+ ".": "./index.js",
9
+ "./babel-plugin-scoped-class": "./src/babel-plugin-scoped-class.js",
10
+ "./test-helper": "./src/scopedClass.js"
11
+ },
7
12
  "keywords": [],
8
13
  "author": "",
9
14
  "license": "ISC",
@@ -1,13 +1,13 @@
1
- const path = require('path');
2
- const getPostfix = require('./getPostfix');
3
- const rewriteCss = require('./rewriteCss');
4
- const { readFile } = require('fs').promises;
5
- const fsExists = require('./fsExists');
6
- const findCssInJs = require('./findCssInJs');
7
- const getImportedCssFiles = require('./getImportedCssFiles');
8
- const recast = require('recast');
1
+ import path from 'path';
2
+ import getPostfix from './getPostfix.js';
3
+ import rewriteCss from './rewriteCss.js';
4
+ import { readFile } from 'fs/promises';
5
+ import fsExists from './fsExists.js';
6
+ import findCssInJs from './findCssInJs.js';
7
+ import getImportedCssFiles from './getImportedCssFiles.js';
8
+ import recast from 'recast';
9
9
 
10
- module.exports = function () {
10
+ export default function () {
11
11
  return {
12
12
  name: 'addon-css-rollup',
13
13
 
@@ -89,4 +89,4 @@ module.exports = function () {
89
89
  }
90
90
  },
91
91
  };
92
- };
92
+ }
@@ -1,11 +1,11 @@
1
- const { readFile } = require('fs').promises;
2
- const getPostfix = require('./getPostfix');
3
- const replaceHbsInJs = require('./replaceHbsInJs');
4
- const getClassesTagsFromCss = require('./getClassesTagsFromCss');
5
- const rewriteHbs = require('./rewriteHbs');
6
- const fsExists = require('./fsExists');
1
+ import { readFile } from 'fs/promises';
2
+ import getPostfix from './getPostfix.js';
3
+ import replaceHbsInJs from './replaceHbsInJs.js';
4
+ import getClassesTagsFromCss from './getClassesTagsFromCss.js';
5
+ import rewriteHbs from './rewriteHbs.js';
6
+ import fsExists from './fsExists.js';
7
7
 
8
- module.exports = function rollupCssColocation(options = {}) {
8
+ export default function rollupCssColocation(options = {}) {
9
9
  return {
10
10
  name: 'addon-hbs-rollup',
11
11
 
@@ -39,4 +39,4 @@ module.exports = function rollupCssColocation(options = {}) {
39
39
  }
40
40
  },
41
41
  };
42
- };
42
+ }
@@ -1,15 +1,15 @@
1
- const { createUnplugin } = require('unplugin');
2
- const { readFile } = require('fs').promises;
3
- const path = require('path');
4
- const getClassesTagsFromCss = require('./getClassesTagsFromCss');
5
- const getPostfix = require('./getPostfix');
6
- const replaceHbsInJs = require('./replaceHbsInJs');
7
- const rewriteHbs = require('./rewriteHbs');
8
- const fsExists = require('./fsExists');
9
- const findCssInJs = require('./findCssInJs');
10
- const recast = require('recast');
11
-
12
- module.exports = createUnplugin((options) => {
1
+ import { createUnplugin } from 'unplugin';
2
+ import { readFile } from 'fs/promises';
3
+ import path from 'path';
4
+ import getClassesTagsFromCss from './getClassesTagsFromCss.js';
5
+ import getPostfix from './getPostfix.js';
6
+ import replaceHbsInJs from './replaceHbsInJs.js';
7
+ import rewriteHbs from './rewriteHbs.js';
8
+ import fsExists from './fsExists.js';
9
+ import findCssInJs from './findCssInJs.js';
10
+ import recast from 'recast';
11
+
12
+ export default createUnplugin((options) => {
13
13
  return {
14
14
  name: 'addon-js-unplugin',
15
15
 
@@ -1,9 +1,9 @@
1
- const path = require('path');
2
- const getPostfix = require('./getPostfix');
3
- const rewriteCss = require('./rewriteCss');
4
- const fsExists = require('./fsExists');
1
+ import path from 'path';
2
+ import getPostfix from './getPostfix.js';
3
+ import rewriteCss from './rewriteCss.js';
4
+ import fsExists from './fsExists.js';
5
5
 
6
- module.exports = function () {
6
+ export default function () {
7
7
  return {
8
8
  name: 'addon-rewritecss-rollup',
9
9
 
@@ -26,4 +26,4 @@ module.exports = function () {
26
26
  }
27
27
  },
28
28
  };
29
- };
29
+ }
@@ -1,11 +1,11 @@
1
- const { createUnplugin } = require('unplugin');
2
- const path = require('path');
3
- const { readFile, writeFile } = require('fs').promises;
4
- const { Compilation } = require('webpack');
5
- const getPostfix = require('./getPostfix');
6
- const cheerio = require('cheerio');
7
-
8
- module.exports = createUnplugin(({ appDir, loaders, htmlEntrypointInfo }) => {
1
+ import { createUnplugin } from 'unplugin';
2
+ import path from 'path';
3
+ import { readFile, writeFile } from 'fs/promises';
4
+ import { Compilation } from 'webpack';
5
+ import getPostfix from './getPostfix.js';
6
+ import cheerio from 'cheerio';
7
+
8
+ export default createUnplugin(({ appDir, loaders, htmlEntrypointInfo }) => {
9
9
  return {
10
10
  name: 'app-css-livereload-loader',
11
11
 
@@ -1,11 +1,11 @@
1
- // const { createUnplugin } = require('unplugin');
2
- const { basename, join } = require('path');
3
- const fsExists = require('./fsExists');
4
- const getPostfix = require('./getPostfix');
5
- const rewriteCss = require('./rewriteCss');
6
- // const path = require('path');
1
+ // import { createUnplugin } from 'unplugin';
2
+ import { basename, join } from 'path';
3
+ import fsExists from './fsExists.js';
4
+ import getPostfix from './getPostfix.js';
5
+ import rewriteCss from './rewriteCss.js';
6
+ // import path from 'path';
7
7
 
8
- module.exports = async function (code) {
8
+ export default async function (code) {
9
9
  const cssPath = this.resourcePath;
10
10
  const cssFileName = basename(cssPath);
11
11
  const postfix = getPostfix(cssPath);
@@ -18,11 +18,11 @@ module.exports = async function (code) {
18
18
  ]);
19
19
 
20
20
  let rewrittenCss;
21
- if (hbsExists || gjsExists && cssPath.startsWith(this.rootContext)) {
21
+ if (hbsExists || (gjsExists && cssPath.startsWith(this.rootContext))) {
22
22
  rewrittenCss = rewriteCss(code, postfix, cssFileName);
23
23
  } else {
24
24
  rewrittenCss = code;
25
25
  }
26
26
 
27
27
  return rewrittenCss;
28
- };
28
+ }
@@ -1,13 +1,12 @@
1
- const { createUnplugin } = require('unplugin');
2
- const replaceGlimmerAst = require('./replaceGlimmerAst');
3
- const path = require('path');
4
- const getPostfix = require('./getPostfix');
5
- const getClassesTagsFromCss = require('./getClassesTagsFromCss');
6
- const { readFile } = require('fs').promises;
7
- const fsExists = require('./fsExists');
1
+ import { createUnplugin } from 'unplugin';
2
+ import replaceGlimmerAst from './replaceGlimmerAst.js';
3
+ import path from 'path';
4
+ import getPostfix from './getPostfix.js';
5
+ import getClassesTagsFromCss from './getClassesTagsFromCss.js';
6
+ import { readFile } from 'fs/promises';
7
+ import fsExists from './fsExists.js';
8
8
 
9
-
10
- module.exports = createUnplugin(() => {
9
+ export default createUnplugin(() => {
11
10
  return {
12
11
  name: 'app-css-unplugin',
13
12
 
@@ -1,6 +1,6 @@
1
- const fsExists = require('./fsExists');
1
+ import fsExists from './fsExists.js';
2
2
 
3
- module.exports = async function (source) {
3
+ export default async function (source) {
4
4
  if (this.resourcePath.endsWith('.js')) {
5
5
  const hbsExists = await fsExists(this.resourcePath.replace(/\.js/, '.hbs'));
6
6
  if (hbsExists) {
@@ -16,4 +16,4 @@ module.exports = async function (source) {
16
16
  }
17
17
 
18
18
  return source;
19
- };
19
+ }
@@ -1,10 +1,10 @@
1
- const { createUnplugin } = require('unplugin');
2
- const replaceGlimmerAst = require('./replaceGlimmerAst');
3
- const path = require('path');
4
- const getPostfix = require('./getPostfix');
5
- const getClassesTagsFromCss = require('./getClassesTagsFromCss');
6
- const { readFile } = require('fs').promises;
7
- const fsExists = require('./fsExists');
1
+ import { createUnplugin } from 'unplugin';
2
+ import replaceGlimmerAst from './replaceGlimmerAst.js';
3
+ import path from 'path';
4
+ import getPostfix from './getPostfix.js';
5
+ import getClassesTagsFromCss from './getClassesTagsFromCss.js';
6
+ import { readFile } from 'fs/promises';
7
+ import fsExists from './fsExists.js';
8
8
 
9
9
  function* iterateOpcodes(opcodes) {
10
10
  for (let instruction of opcodes) {
@@ -37,7 +37,7 @@ function inflateTagName(tag) {
37
37
  throw new Error('Unknown tag');
38
38
  }
39
39
 
40
- module.exports = createUnplugin(({ appDir }) => {
40
+ export default createUnplugin(({ appDir }) => {
41
41
  return {
42
42
  name: 'app-js-unplugin',
43
43
 
@@ -1,12 +1,12 @@
1
- // const { RawSource } = require('webpack-sources');
2
- const rewriteCss = require('./rewriteCss');
3
- const { readFile, writeFile } = require('fs').promises;
4
- const path = require('path');
5
- const getPostfix = require('./getPostfix');
6
- const fsExists = require('./fsExists');
7
- const getFiles = require('./getFiles');
1
+ // import { RawSource } from 'webpack-sources';
2
+ import rewriteCss from './rewriteCss.js';
3
+ import { readFile, writeFile } from 'fs/promises';
4
+ import path from 'path';
5
+ import getPostfix from './getPostfix.js';
6
+ import fsExists from './fsExists.js';
7
+ import getFiles from './getFiles.js';
8
8
 
9
- module.exports = class {
9
+ export default class {
10
10
  apply(compiler) {
11
11
  if (process.env.EMBER_ENV === 'production') {
12
12
  return;
@@ -65,4 +65,4 @@ module.exports = class {
65
65
  }
66
66
  );
67
67
  }
68
- };
68
+ }
@@ -1,5 +1,4 @@
1
- const template = require('@babel/template').default;
2
- const replaceScopedClass = require('./replaceScopedClass');
1
+ import replaceScopedClass from './replaceScopedClass.js';
3
2
 
4
3
  const scopedClass = () => {
5
4
  return {
@@ -27,4 +26,4 @@ const scopedClass = () => {
27
26
  };
28
27
  };
29
28
 
30
- module.exports = scopedClass;
29
+ export default scopedClass;
@@ -1,6 +1,6 @@
1
- const recast = require('recast');
1
+ import recast from 'recast';
2
2
 
3
- module.exports = function (script, removeCallExpression = false) {
3
+ export default function (script, removeCallExpression = false) {
4
4
  const ast = typeof script === 'string' ? recast.parse(script) : script;
5
5
  let css = '';
6
6
 
@@ -24,4 +24,4 @@ module.exports = function (script, removeCallExpression = false) {
24
24
  });
25
25
 
26
26
  return { css, ast };
27
- };
27
+ }
package/src/fsExists.js CHANGED
@@ -1,10 +1,10 @@
1
- const { stat } = require('fs').promises;
1
+ import { stat } from 'fs/promises';
2
2
 
3
- module.exports = async function (path) {
3
+ export default async function (path) {
4
4
  try {
5
5
  await stat(path);
6
6
  return true;
7
7
  } catch (e) {
8
8
  return false;
9
9
  }
10
- };
10
+ }
@@ -0,0 +1,5 @@
1
+ import md5 from 'blueimp-md5';
2
+
3
+ export default function (relativePath) {
4
+ return 'e' + md5(relativePath).substring(0, 8);
5
+ }
@@ -1,6 +1,6 @@
1
- const postcss = require('postcss');
2
- const parser = require('postcss-selector-parser');
3
- const isInsideGlobal = require('./isInsideGlobal');
1
+ import postcss from 'postcss';
2
+ import parser from 'postcss-selector-parser';
3
+ import isInsideGlobal from './isInsideGlobal.js';
4
4
 
5
5
  function getClassesAndTags(sel, classes, tags) {
6
6
  const transform = (sls) => {
@@ -16,7 +16,7 @@ function getClassesAndTags(sel, classes, tags) {
16
16
  parser(transform).processSync(sel);
17
17
  }
18
18
 
19
- module.exports = function getClassesTagsFromCss(css) {
19
+ export default function getClassesTagsFromCss(css) {
20
20
  const classes = new Set();
21
21
  const tags = new Set();
22
22
 
@@ -28,4 +28,4 @@ module.exports = function getClassesTagsFromCss(css) {
28
28
  });
29
29
 
30
30
  return { classes, tags };
31
- };
31
+ }
package/src/getFiles.js CHANGED
@@ -1,6 +1,6 @@
1
- const glob = require('glob');
1
+ import glob from 'glob';
2
2
 
3
- module.exports = function (globPath) {
3
+ export default function (globPath) {
4
4
  return new Promise((resolve, reject) => {
5
5
  glob(globPath, (err, files) => {
6
6
  if (err) {
@@ -9,4 +9,4 @@ module.exports = function (globPath) {
9
9
  resolve(files);
10
10
  });
11
11
  });
12
- };
12
+ }
@@ -1,4 +1,4 @@
1
- module.exports = function (css) {
1
+ export default function (css) {
2
2
  const regex = /@import\s+["']?([^"')]+)["']?;/g;
3
3
  const importedCssPaths = [];
4
4
  let match;
@@ -15,4 +15,4 @@ module.exports = function (css) {
15
15
  css,
16
16
  importedCssPaths,
17
17
  };
18
- };
18
+ }
package/src/getPostfix.js CHANGED
@@ -1,7 +1,7 @@
1
- const md5 = require('blueimp-md5');
2
- const path = require('path');
1
+ import generateHash from './generateHash.js';
2
+ import path from 'path';
3
3
 
4
- module.exports = function (cssFileName) {
4
+ export default function (cssFileName) {
5
5
  const relativePath = path.relative(process.cwd(), cssFileName);
6
- return 'e' + md5(relativePath).substring(0, 8);
7
- };
6
+ return generateHash(relativePath);
7
+ }
@@ -1,6 +1,6 @@
1
- module.exports = function isInsideGlobal(node, func) {
1
+ export default function isInsideGlobal(node, func) {
2
2
  const parent = node.parent;
3
3
  if (!parent) return false;
4
4
  if (parent.type === 'pseudo' && parent.value === ':global') return true;
5
5
  return isInsideGlobal(parent, func);
6
- };
6
+ }
@@ -1,4 +1,4 @@
1
- module.exports = function (className, postfix, classesInCss) {
1
+ export default function (className, postfix, classesInCss) {
2
2
  const classes = className.split(/\s+/);
3
3
  const renamedClasses = classes
4
4
  .filter((c) => c)
@@ -11,4 +11,4 @@ module.exports = function (className, postfix, classesInCss) {
11
11
  renamedClasses
12
12
  );
13
13
  return renamedWithPreservedSpaces;
14
- };
14
+ }
@@ -1,15 +1,10 @@
1
- const recast = require('recast');
2
- const babelParser = require('recast/parsers/babel');
3
- const path = require('path');
4
- const { readFile } = require('fs').promises;
5
- const fsExists = require('./fsExists');
1
+ import recast from 'recast';
2
+ import path from 'path';
3
+ import { readFile } from 'fs/promises';
4
+ import fsExists from './fsExists.js';
6
5
 
7
- const parseOptions = {
8
- parser: babelParser,
9
- };
10
-
11
- module.exports = async function (script, id, replaceFunction) {
12
- const ast = recast.parse(script, parseOptions);
6
+ export default async function (script, id, replaceFunction) {
7
+ const ast = recast.parse(script);
13
8
  const cssPath = id.replace(/(\.js)|(\.hbs)/, '.css');
14
9
  let css;
15
10
 
@@ -53,4 +48,4 @@ module.exports = async function (script, id, replaceFunction) {
53
48
  });
54
49
  const resultScript = recast.print(ast).code;
55
50
  return resultScript;
56
- };
51
+ }
@@ -1,12 +1,7 @@
1
- const recast = require('recast');
2
- const babelParser = require('recast/parsers/babel');
1
+ import recast from 'recast';
3
2
 
4
- const parseOptions = {
5
- parser: babelParser,
6
- };
7
-
8
- module.exports = function (script, replaceFunction) {
9
- const ast = recast.parse(script, parseOptions);
3
+ export default function (script, replaceFunction) {
4
+ const ast = recast.parse(script);
10
5
  recast.visit(ast, {
11
6
  visitCallExpression(path) {
12
7
  const node = path.node;
@@ -29,4 +24,4 @@ module.exports = function (script, replaceFunction) {
29
24
  },
30
25
  });
31
26
  return recast.print(ast).code;
32
- };
27
+ }
@@ -1,8 +1,8 @@
1
- const recast = require('ember-template-recast');
2
- const renameClass = require('./renameClass');
3
- const getPostfix = require('./getPostfix');
1
+ import recast from 'ember-template-recast';
2
+ import renameClass from './renameClass.js';
3
+ import getPostfix from './getPostfix.js';
4
4
 
5
- module.exports = function (hbs, templatePath, basePath) {
5
+ export default function (hbs, templatePath, basePath) {
6
6
  let ast = recast.parse(hbs);
7
7
  let stack = [];
8
8
  const cssPath = templatePath.replace(/(\.hbs)?\.js$/, '.css');
@@ -63,4 +63,4 @@ module.exports = function (hbs, templatePath, basePath) {
63
63
 
64
64
  let result = recast.print(ast);
65
65
  return result;
66
- };
66
+ }
package/src/rewriteCss.js CHANGED
@@ -1,6 +1,6 @@
1
- const parser = require('postcss-selector-parser');
2
- const postcss = require('postcss');
3
- const isInsideGlobal = require('./isInsideGlobal');
1
+ import parser from 'postcss-selector-parser';
2
+ import postcss from 'postcss';
3
+ import isInsideGlobal from './isInsideGlobal.js';
4
4
 
5
5
  function rewriteSelector(sel, postfix) {
6
6
  const transform = (selectors) => {
@@ -33,7 +33,7 @@ function isInsideKeyframes(node) {
33
33
  return isInsideKeyframes(parent);
34
34
  }
35
35
 
36
- module.exports = function rewriteCss(css, postfix, fileName) {
36
+ export default function rewriteCss(css, postfix, fileName) {
37
37
  const ast = postcss.parse(css);
38
38
  ast.walk((node) => {
39
39
  if (node.type === 'rule' && !isInsideKeyframes(node)) {
@@ -44,4 +44,4 @@ module.exports = function rewriteCss(css, postfix, fileName) {
44
44
  const rewrittenCss = ast.toString();
45
45
  return `/* ${fileName} */\n@layer components {\n\n` + rewrittenCss + '\n}\n';
46
46
  // return `/* ${fileName} */\n ${rewrittenCss}`;
47
- };
47
+ }
package/src/rewriteHbs.js CHANGED
@@ -1,7 +1,7 @@
1
- const recast = require('ember-template-recast');
2
- const renameClass = require('./renameClass');
1
+ import recast from 'ember-template-recast';
2
+ import renameClass from './renameClass.js';
3
3
 
4
- module.exports = function rewriteHbs(hbs, classes, tags, postfix) {
4
+ export default function rewriteHbs(hbs, classes, tags, postfix) {
5
5
  let ast = recast.parse(hbs);
6
6
 
7
7
  recast.traverse(ast, {
@@ -39,4 +39,4 @@ module.exports = function rewriteHbs(hbs, classes, tags, postfix) {
39
39
 
40
40
  let result = recast.print(ast);
41
41
  return result;
42
- };
42
+ }
@@ -1,14 +1,12 @@
1
- const fs = require('fs/promises');
2
- const path = require('path');
3
- const {
4
- preprocessEmbeddedTemplates,
5
- } = require('ember-template-imports/lib/preprocess-embedded-templates.js');
6
- const {
1
+ import fs from 'fs/promises';
2
+ import path from 'path';
3
+ import { preprocessEmbeddedTemplates } from 'ember-template-imports/lib/preprocess-embedded-templates.js';
4
+ import {
7
5
  TEMPLATE_TAG_NAME,
8
6
  TEMPLATE_TAG_PLACEHOLDER,
9
- } = require('ember-template-imports/lib/util.js');
7
+ } from 'ember-template-imports/lib/util.js';
10
8
 
11
- module.exports = function firstClassComponentTemplates() {
9
+ export default function firstClassComponentTemplates() {
12
10
  return {
13
11
  name: 'preprocess-fccts',
14
12
  async resolveId(source, importer, options) {
@@ -42,7 +40,7 @@ module.exports = function firstClassComponentTemplates() {
42
40
  }
43
41
  },
44
42
  };
45
- };
43
+ }
46
44
 
47
45
  const FCCT_EXTENSION = /\.g([jt]s)$/;
48
46
 
@@ -1,6 +1,6 @@
1
- const getPostfix = require('./getPostfix');
2
- const renameClass = require('./renameClass');
1
+ import generateHash from './generateHash.js';
2
+ import renameClass from './renameClass.js';
3
3
 
4
- module.exports.scopedClass = function (className, relativeCssPath) {
5
- return renameClass(className, getPostfix(relativeCssPath));
6
- };
4
+ export function scopedClass(className, relativeCssPath) {
5
+ return renameClass(className, generateHash(relativeCssPath));
6
+ }
@@ -1,5 +1,5 @@
1
- const expect = require('chai').expect;
2
- const getClassesTagsFromCss = require('../src/getClassesTagsFromCss');
1
+ import { expect } from 'chai';
2
+ import getClassesTagsFromCss from '../src/getClassesTagsFromCss.js';
3
3
 
4
4
  describe('rewriteCss', function () {
5
5
  it('should return classes and tags that are not in :global', function () {
@@ -1,6 +1,6 @@
1
- const expect = require('chai').expect;
2
- const { stub } = require('sinon');
3
- const getPostfix = require('../src/getPostfix');
1
+ import { expect } from 'chai';
2
+ import { stub } from 'sinon';
3
+ import getPostfix from '../src/getPostfix.js';
4
4
 
5
5
  describe('getPostfix', function () {
6
6
  it('should return a string', function () {
@@ -1,6 +1,6 @@
1
- const expect = require('chai').expect;
2
- const { stub } = require('sinon');
3
- const rewriteCss = require('../src/rewriteCss');
1
+ import { expect } from 'chai';
2
+ import { stub } from 'sinon';
3
+ import rewriteCss from '../src/rewriteCss.js';
4
4
 
5
5
  describe('rewriteCss', function () {
6
6
  it('should rewrite css', function () {