UNPKG

626 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6
7const loader_utils_1 = require("loader-utils");
8
9const chalk_1 = require("chalk");
10
11const JSX_REGEX = /\.jsx$/;
12
13module.exports = function () {
14 const extension = JSX_REGEX.test(this.resourcePath) ? '.jsx' : '.tsx';
15 const options = loader_utils_1.getOptions(this);
16 throw new Error(`sewing-kit could not parse ${chalk_1.default.bold(this.resourcePath.replace(options.root, ''))} because ${extension} files depend on React.\nIf this is a React application, add React's libraries using ${chalk_1.default.bold('yarn add react react-dom')}`);
17};
\No newline at end of file