From 8451d2f38e06f5ef681e0f949bf2c454059a24fd Mon Sep 17 00:00:00 2001
From: knowankit <44323532+knowankit@users.noreply.github.com>
Date: Sun, 10 Oct 2021 09:52:32 +0530
Subject: [PATCH 1/3] fix: sourcemap
---
package.json | 2 +-
templates/javascript/src/example-component.js | 1 +
templates/javascript/webpack.config.js | 17 ++++++++++++++++-
templates/typescript/webpack.config.js | 19 +++++++++++++++++--
4 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/package.json b/package.json
index c52f9b9..4250ffb 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "build-react-npm",
- "version": "0.3.0",
+ "version": "0.3.3",
"description": "Create your react npm library and publish it in no time",
"main": "src/index.js",
"scripts": {
diff --git a/templates/javascript/src/example-component.js b/templates/javascript/src/example-component.js
index 97a74f1..d33b7f9 100644
--- a/templates/javascript/src/example-component.js
+++ b/templates/javascript/src/example-component.js
@@ -1,5 +1,6 @@
import styles from './index.module.css';
import PropTypes from 'prop-types';
+import React from 'react';
const ExampleComponent = ({ text }) => {
return
{text}
;
diff --git a/templates/javascript/webpack.config.js b/templates/javascript/webpack.config.js
index 80d552a..e854b58 100644
--- a/templates/javascript/webpack.config.js
+++ b/templates/javascript/webpack.config.js
@@ -6,6 +6,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = env => {
const config = {
mode: env.development ? 'development' : 'production',
+ devtool: 'inline-source-map',
entry: env.development
? `${path.resolve(__dirname, './src/index.js')}`
: `${path.resolve(__dirname, './src/example-component.js')}`,
@@ -46,7 +47,21 @@ module.exports = env => {
resolve: {
extensions: ['.js', '.jsx']
},
- plugins: [new CleanWebpackPlugin()]
+ plugins: [new CleanWebpackPlugin()],
+ externals: {
+ react: {
+ root: 'React',
+ commonjs2: 'react',
+ commonjs: 'react',
+ amd: 'react'
+ },
+ 'react-dom': {
+ root: 'ReactDOM',
+ commonjs2: 'react-dom',
+ commonjs: 'react-dom',
+ amd: 'react-dom'
+ }
+ }
};
if (env.development) {
diff --git a/templates/typescript/webpack.config.js b/templates/typescript/webpack.config.js
index f420f16..92f995a 100644
--- a/templates/typescript/webpack.config.js
+++ b/templates/typescript/webpack.config.js
@@ -3,9 +3,10 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
-module.exports = (env) => {
+module.exports = env => {
const config = {
mode: env.development ? 'development' : 'production',
+ devtool: 'inline-source-map',
entry: {
main: env.development
? `${path.resolve(__dirname, './src/index.tsx')}`
@@ -43,7 +44,21 @@ module.exports = (env) => {
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
- plugins: [new CleanWebpackPlugin()]
+ plugins: [new CleanWebpackPlugin()],
+ externals: {
+ react: {
+ root: 'React',
+ commonjs2: 'react',
+ commonjs: 'react',
+ amd: 'react'
+ },
+ 'react-dom': {
+ root: 'ReactDOM',
+ commonjs2: 'react-dom',
+ commonjs: 'react-dom',
+ amd: 'react-dom'
+ }
+ }
};
if (env.development) {
From 4f15cbc3a2024d7d228f2768f58ba87b069ad189 Mon Sep 17 00:00:00 2001
From: knowankit <44323532+knowankit@users.noreply.github.com>
Date: Sun, 10 Oct 2021 09:53:34 +0530
Subject: [PATCH 2/3] fix: add lock file
---
package-lock.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index de06a38..97e9291 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "build-react-npm",
- "version": "0.2.7",
+ "version": "0.3.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "build-react-npm",
- "version": "0.2.7",
+ "version": "0.3.3",
"license": "MIT",
"dependencies": {
"arg": "^5.0.1",
From eb66b043022365c9b455240e2b8345df695f1442 Mon Sep 17 00:00:00 2001
From: knowankit <44323532+knowankit@users.noreply.github.com>
Date: Sun, 10 Oct 2021 09:55:12 +0530
Subject: [PATCH 3/3] docs: udpate readme
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index c39c4a1..5c1bde2 100644
--- a/README.md
+++ b/README.md
@@ -114,6 +114,7 @@ Congratlations 🎉, you have published your package
## Libraries bootstrapped from this CLI - build-react-npm
* [React bubble effect button](https://github.com/knowankit/react-bubbly-effect-button)
+* [Particle effect on text](https://github.com/knowankit/particle-text-effect)
## License