restore composer.json, add mysqli extension
This commit is contained in:
132
public/vendor/editor/config/common/dev.common.config.js
vendored
Executable file
132
public/vendor/editor/config/common/dev.common.config.js
vendored
Executable file
@@ -0,0 +1,132 @@
|
||||
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
const scssConfig = require('./scss.config');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const pkg = require('../../package.json');
|
||||
|
||||
const productList = [
|
||||
'summernote',
|
||||
'summernote-bs4',
|
||||
'summernote-lite',
|
||||
];
|
||||
|
||||
let entries = {};
|
||||
fs.readdirSync(path.resolve(__dirname, '../../lang')).forEach(file => {
|
||||
const filename = file.replace('.js', '');
|
||||
entries[filename] = `./lang/${filename}`;
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
entries,
|
||||
output: {
|
||||
path: path.join(__dirname, 'dist'),
|
||||
filename: (chunkData) => {
|
||||
var isProduct = productList.includes(chunkData.chunk.name);
|
||||
return isProduct ? '[name].js' : 'lang/[name].js';
|
||||
},
|
||||
},
|
||||
externals: {
|
||||
jquery: 'jQuery', // dev includes jQuery by <script> tag
|
||||
},
|
||||
devServer: {
|
||||
port: 3000,
|
||||
contentBase: ['./dist'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'eslint-loader',
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
use: [
|
||||
{
|
||||
loader: 'string-replace-loader',
|
||||
options: {
|
||||
search: '@@VERSION@@',
|
||||
replace: pkg.version,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'html-loader',
|
||||
options: {
|
||||
minimize: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
scssConfig,
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[name].[ext]',
|
||||
outputPath: 'images',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(woff|woff2|ttf|otf|eot)$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[name].[ext]',
|
||||
outputPath: 'font',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].css',
|
||||
}),
|
||||
new CopyPlugin([
|
||||
{
|
||||
from: 'examples',
|
||||
to: 'examples',
|
||||
},
|
||||
{
|
||||
from: 'plugin',
|
||||
to: 'plugin',
|
||||
},
|
||||
]),
|
||||
new HtmlWebPackPlugin({
|
||||
inject: true,
|
||||
chunks: ['summernote'],
|
||||
template: `./src/summernote-bs3.html`,
|
||||
filename: 'index.html',
|
||||
}),
|
||||
new HtmlWebPackPlugin({
|
||||
inject: true,
|
||||
chunks: ['summernote-bs4'],
|
||||
template: `./src/summernote-bs4.html`,
|
||||
filename: 'bs4.html',
|
||||
}),
|
||||
new HtmlWebPackPlugin({
|
||||
inject: true,
|
||||
chunks: ['summernote-lite'],
|
||||
template: `./src/summernote-lite.html`,
|
||||
filename: 'lite.html',
|
||||
}),
|
||||
],
|
||||
};
|
||||
14
public/vendor/editor/config/common/lang.config.js
vendored
Executable file
14
public/vendor/editor/config/common/lang.config.js
vendored
Executable file
@@ -0,0 +1,14 @@
|
||||
const testFolder = './lang/';
|
||||
const fs = require('fs');
|
||||
|
||||
const files = fs.readdirSync(testFolder);
|
||||
|
||||
let entries = {};
|
||||
|
||||
files.forEach(file => {
|
||||
const key = file.split('.')[0];
|
||||
|
||||
entries[key] = `./lang/${file}`;
|
||||
});
|
||||
|
||||
module.exports = entries;
|
||||
179
public/vendor/editor/config/common/production.common.config.js
vendored
Executable file
179
public/vendor/editor/config/common/production.common.config.js
vendored
Executable file
@@ -0,0 +1,179 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const webpack = require('webpack');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
const scssConfig = require('./scss.config');
|
||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||
const ZipPlugin = require('zip-webpack-plugin');
|
||||
|
||||
const pkg = require('../../package.json');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
||||
|
||||
const date = (new Date()).toISOString().replace(/:\d+\.\d+Z$/, 'Z');
|
||||
const banner = `
|
||||
Super simple wysiwyg editor v${pkg.version}
|
||||
https://summernote.org
|
||||
|
||||
|
||||
Copyright 2013- Alan Hong. and other contributors
|
||||
summernote may be freely distributed under the MIT license.
|
||||
|
||||
Date: ${date}
|
||||
`;
|
||||
const minBanner = `Summernote v${pkg.version} | (c) 2013- Alan Hong and other contributors | MIT license`;
|
||||
|
||||
const productList = [
|
||||
'summernote',
|
||||
'summernote-bs4',
|
||||
'summernote-lite',
|
||||
'summernote.min',
|
||||
'summernote-bs4.min',
|
||||
'summernote-lite.min',
|
||||
];
|
||||
|
||||
let entries = {};
|
||||
fs.readdirSync(path.resolve(__dirname, '../../lang')).forEach(file => {
|
||||
const filename = file.replace('.js', '');
|
||||
const entryKey = `${filename}.min`;
|
||||
entries[entryKey] = `./lang/${filename}`;
|
||||
entries[filename] = `./lang/${filename}`;
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
entries,
|
||||
output: {
|
||||
path: path.join(__dirname, '../../dist'),
|
||||
libraryTarget: 'umd',
|
||||
filename: (chunkData) => {
|
||||
var isProduct = productList.includes(chunkData.chunk.name);
|
||||
return isProduct ? '[name].js' : 'lang/[name].js';
|
||||
},
|
||||
},
|
||||
externals: {
|
||||
jquery: {
|
||||
root: 'jQuery',
|
||||
commonjs2: 'jquery',
|
||||
commonjs: 'jquery',
|
||||
amd: 'jquery',
|
||||
},
|
||||
},
|
||||
devtool: false,
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
chunkFilter: (chunk) => {
|
||||
// xxx.min file is minified
|
||||
if (chunk.name.includes('min')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
parallel: 3,
|
||||
cache: true,
|
||||
sourceMap: true,
|
||||
terserOptions: {
|
||||
sourceMap: true,
|
||||
ecma: 8,
|
||||
compress: {
|
||||
warnings: false,
|
||||
},
|
||||
},
|
||||
}),
|
||||
new OptimizeCssAssetsPlugin({
|
||||
assetNameRegExp: /\min\.css$/g,
|
||||
sourceMap: true,
|
||||
cssProcessor: require('cssnano'),
|
||||
cssProcessorPluginOptions: {
|
||||
preset: ['default', {
|
||||
discardComments: {
|
||||
removeAll: true,
|
||||
},
|
||||
}],
|
||||
},
|
||||
canPrint: true,
|
||||
}),
|
||||
],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
use: [
|
||||
{
|
||||
loader: 'string-replace-loader',
|
||||
options: {
|
||||
search: '@@VERSION@@',
|
||||
replace: pkg.version,
|
||||
},
|
||||
}, {
|
||||
loader: 'babel-loader',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'html-loader',
|
||||
options: {
|
||||
minimize: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
scssConfig,
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[name].[ext]',
|
||||
outputPath: 'images',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(woff|woff2|ttf|otf|eot)$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[name].[ext]',
|
||||
outputPath: 'font',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin(),
|
||||
new webpack.BannerPlugin({
|
||||
banner: ({ basename }) => {
|
||||
return basename.includes('min') ? minBanner : banner;
|
||||
},
|
||||
}),
|
||||
new MiniCssExtractPlugin({
|
||||
filename: `[name].css`,
|
||||
}),
|
||||
new CopyPlugin([
|
||||
{
|
||||
from: 'plugin',
|
||||
to: 'plugin',
|
||||
},
|
||||
]),
|
||||
new webpack.SourceMapDevToolPlugin({
|
||||
test: /(summernote|summernote\-bs4|summernote\-lite)(\.min)?\.js$/g,
|
||||
filename: '[name].js.map',
|
||||
}),
|
||||
new ZipPlugin({
|
||||
filename: `summernote-${pkg.version}-dist.zip`,
|
||||
}),
|
||||
],
|
||||
};
|
||||
22
public/vendor/editor/config/common/scss.config.js
vendored
Executable file
22
public/vendor/editor/config/common/scss.config.js
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
|
||||
module.exports = {
|
||||
test: /\.(sa|sc|c)ss$/,
|
||||
use: [
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
},
|
||||
{
|
||||
loader: 'css-loader',
|
||||
},
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
},
|
||||
{
|
||||
loader: 'sass-loader',
|
||||
options: {
|
||||
implementation: require('sass'),
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user