chore: removes webpack build script from next package

This commit is contained in:
James
2024-03-07 10:11:30 -05:00
parent 4d2f1ca10e
commit 83c0b8b96e
2 changed files with 1 additions and 88 deletions

View File

@@ -8,7 +8,6 @@
"@payloadcms/next": "./dist/bin/index.js"
},
"scripts": {
"build:webpack": "webpack --config webpack.config.js",
"build": "pnpm copyfiles && pnpm build:swc && pnpm build:types",
"build:swc": "swc ./src -d ./dist --config-file .swcrc",
"build:types": "tsc --emitDeclarationOnly --outDir dist",
@@ -62,9 +61,7 @@
"sass-loader": "^14.1.1",
"swc-loader": "^0.2.6",
"terser-webpack-plugin": "^5.3.10",
"url-loader": "^4.1.1",
"webpack": "^5.78.0",
"webpack-cli": "^5.1.4"
"url-loader": "^4.1.1"
},
"dependencies": {
"@dnd-kit/core": "6.0.8",

View File

@@ -1,84 +0,0 @@
const OptimizeCSSAssetsPlugin = require('css-minimizer-webpack-plugin')
const MiniCSSExtractPlugin = require('mini-css-extract-plugin')
const path = require('path')
const TerserJSPlugin = require('terser-webpack-plugin')
const componentWebpackConfig = {
entry: path.resolve(__dirname, './src/index.ts'),
externals: ['react', 'react-dom', /^payload.*/, /^next.*/, 'react-image-crop'],
externalsType: 'commonjs',
mode: 'production',
module: {
rules: [
{
// exclude: /node_modules/,
test: /\.(t|j)sx?$/,
use: [
{
loader: require.resolve('swc-loader'),
options: {
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
},
},
},
},
],
},
{
sideEffects: true,
test: /\.(scss|css)$/,
use: [
MiniCSSExtractPlugin.loader,
'css-loader',
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: ['postcss-preset-env'],
},
},
},
'sass-loader',
],
},
{
loader: require.resolve('url-loader'),
options: {
name: 'static/[name].[hash:8].[ext]',
limit: 10000,
},
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.woff$/, /\.woff2$/, /\.svg$/],
},
],
},
optimization: {
minimizer: [
new TerserJSPlugin({
extractComments: false,
}),
new OptimizeCSSAssetsPlugin({}),
],
},
output: {
filename: 'index.js',
libraryTarget: 'commonjs2',
path: path.resolve(__dirname, './dist'),
publicPath: '/',
},
plugins: [
new MiniCSSExtractPlugin({
filename: 'styles.css',
ignoreOrder: true,
}),
],
resolve: {
extensions: ['.tsx', '.ts', '.js'],
modules: ['node_modules', path.resolve(__dirname, '../../node_modules')],
},
stats: 'errors-only',
}
module.exports = componentWebpackConfig