react-style-tag
Version:
Write scoped, autoprefixed styles declaratively in React
43 lines (34 loc) • 890 B
JavaScript
const ESLintWebpackPlugin = require('eslint-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
const ROOT = __dirname;
module.exports = {
devtool: 'source-map',
entry: [path.resolve(ROOT, 'DEV_ONLY', 'index.tsx')],
mode: 'development',
module: {
rules: [
{
include: [path.resolve(ROOT, 'src'), path.resolve(ROOT, 'DEV_ONLY')],
loader: 'babel-loader',
test: /\.(js|ts|tsx)$/,
},
],
},
output: {
filename: 'react-style-tag.js',
library: 'Style',
libraryTarget: 'umd',
path: path.resolve(ROOT, 'dist'),
umdNamedDefine: true,
},
plugins: [
new webpack.EnvironmentPlugin(['NODE_ENV']),
new HtmlWebpackPlugin(),
new ESLintWebpackPlugin(),
],
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
};