Skip to content

Commit ae34272

Browse files
author
nezanuha
committed
updated dependencies
1 parent a4a7c57 commit ae34272

File tree

2 files changed

+42
-58
lines changed

2 files changed

+42
-58
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "markdown-text-editor",
3-
"version": "0.0.6-beta.1",
3+
"version": "0.0.7-beta.1",
44
"description": "A powerful, easy-to-use Markdown editor with a real-time preview, syntax highlighting. Ideal for developers, writers, and content creators who need a seamless, interactive writing experience with full Markdown support.",
5-
"main": "dist/markdown-text-editor.min.js",
5+
"main": "dist/markdown-text-editor.js",
66
"repository": {
77
"type": "github",
88
"url": "git+https://github.com/nezanuha/markdown-text-editor.git"

webpack.config.js

Lines changed: 40 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,47 @@
11
const path = require('path');
22
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3-
const TerserPlugin = require('terser-webpack-plugin');
43

5-
module.exports = (env, argv) => {
6-
const isProd = argv.mode === 'production';
7-
return {
8-
mode: isProd ? 'production' : 'development', // Set to 'production' for minified output
9-
entry: {
10-
"index":'./src/plugins/index.js',
11-
"markdown-text-editor": './src/plugins/markdown/editor.js'
12-
},
13-
output: {
14-
filename: '[name].min.js', // Output file name
15-
path: path.resolve(__dirname, 'dist'), // Output directory
16-
library: '[name]', // Name of the library
17-
libraryTarget: 'umd', // Universal Module Definition
18-
libraryExport: 'default', // Use default export
19-
globalObject: 'this', // Ensures it works in Node.js and browser
20-
},
21-
module: {
22-
rules: [
23-
{
24-
test: /\.css$/, // Handle CSS files
25-
use: [
26-
27-
'style-loader', // Inject CSS into the DOM
28-
'css-loader', // Translates CSS into CommonJS
29-
'postcss-loader', // Processes CSS with PostCSS
30-
],
31-
},
32-
{
33-
test: /\.m?js$/, // Handle JavaScript files
34-
exclude: /node_modules/,
35-
use: {
36-
loader: 'babel-loader',
37-
options: {
38-
presets: ['@babel/preset-env'],
39-
},
4+
module.exports = {
5+
entry: {
6+
"index":'./src/plugins/index.js',
7+
"markdown-text-editor": './src/plugins/markdown/editor.js'
8+
},
9+
output: {
10+
filename: '[name].js', // Output file name
11+
path: path.resolve(__dirname, 'dist'), // Output directory
12+
library: '[name]', // Name of the library
13+
libraryTarget: 'umd', // Universal Module Definition
14+
libraryExport: 'default', // Use default export
15+
globalObject: 'this', // Ensures it works in Node.js and browser
16+
},
17+
module: {
18+
rules: [
19+
{
20+
test: /\.css$/, // Handle CSS files
21+
use: [
22+
23+
'style-loader', // Inject CSS into the DOM
24+
'css-loader', // Translates CSS into CommonJS
25+
'postcss-loader', // Processes CSS with PostCSS
26+
],
27+
},
28+
{
29+
test: /\.m?js$/, // Handle JavaScript files
30+
exclude: /node_modules/,
31+
use: {
32+
loader: 'babel-loader',
33+
options: {
34+
presets: ['@babel/preset-env'],
4035
},
4136
},
42-
],
43-
},
44-
plugins: [
45-
new MiniCssExtractPlugin({
46-
filename: '[name].min.css', // Output CSS filename
47-
}),
37+
},
4838
],
49-
devtool: isProd ? false : 'source-map', // Enable source maps for easier debugging
50-
optimization: {
51-
minimize: true, // Enable minimization
52-
minimizer: [
53-
new TerserPlugin({
54-
terserOptions: {
55-
format: {
56-
comments: false, // Remove comments
57-
},
58-
},
59-
}),
60-
],
61-
}
62-
}
39+
},
40+
plugins: [
41+
new MiniCssExtractPlugin({
42+
filename: 'styles.css', // Output CSS filename
43+
}),
44+
],
45+
mode: 'production', // Set to 'production' for minified output
46+
devtool: 'source-map', // Enable source maps for easier debugging
6347
};

0 commit comments

Comments
 (0)