mirror of
https://github.com/aleleba/create-react-component-library.git
synced 2025-07-21 03:58:17 -06:00
PR-440978: Adding Cypress Component Testing.
This commit is contained in:
@ -7,28 +7,28 @@ import nodeExternals from 'webpack-node-externals';
|
||||
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
|
||||
import TerserPlugin from 'terser-webpack-plugin';
|
||||
import ESLintPlugin from 'eslint-webpack-plugin';
|
||||
import { resolveTsAliases } from 'resolve-ts-aliases';
|
||||
|
||||
const dotEnvToParse = dotenv.config();
|
||||
const libraryName = process.env.LIBRARY_NAME ? process.env.LIBRARY_NAME : "ui-library"
|
||||
const externalCss = process.env.EXTERNAL_CSS === 'true' ? true : false
|
||||
const externalCssName = process.env.EXTERNAL_CSS_NAME ? process.env.EXTERNAL_CSS_NAME : 'index.css'
|
||||
const alias = resolveTsAliases(path.resolve('tsconfig.json'));
|
||||
|
||||
export default {
|
||||
entry: './src/components/index.tsx',
|
||||
externals: [nodeExternals()],
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx','.ts','.tsx', '.json'],
|
||||
alias: {
|
||||
'@components': path.resolve(__dirname, 'src/components/'),
|
||||
}
|
||||
alias,
|
||||
},
|
||||
mode: 'production',
|
||||
output: {
|
||||
filename: 'index.js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
library: libraryName,
|
||||
library: libraryName,
|
||||
libraryTarget: 'umd',
|
||||
globalObject: 'this',
|
||||
globalObject: 'this',
|
||||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin(),
|
||||
@ -44,12 +44,6 @@ export default {
|
||||
],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(tsx|ts)$/,
|
||||
loader: "ts-loader",
|
||||
exclude: /node_modules/,
|
||||
options: { reportFiles: ['src/**/*.{ts,tsx}', '!src/**/*.stories.{ts,tsx}'] }
|
||||
},
|
||||
{
|
||||
test: /\.(js|jsx|ts|tsx)$/,
|
||||
exclude: /node_modules/,
|
||||
|
Reference in New Issue
Block a user