1 | import { resolve } from 'path';
|
2 |
|
3 | import {
|
4 | CSS,
|
5 | prepareCompilationEnvironment,
|
6 | cleanupCompilationEnvironment,
|
7 | } from './utils/compile';
|
8 |
|
9 | // All further imports/requires will be transpiled
|
10 | // eslint-disable-next-line import/first
|
11 | import 'babel-register';
|
12 |
|
13 | function compileCSS(entryPointFilePath) {
|
14 | prepareCompilationEnvironment();
|
15 | const entryPointFileAbsolutePath = resolve(entryPointFilePath);
|
16 | // eslint-disable-next-line global-require, import/no-dynamic-require
|
17 | require(entryPointFileAbsolutePath);
|
18 | cleanupCompilationEnvironment();
|
19 | return CSS;
|
20 | }
|
21 |
|
22 | export default compileCSS;
|