mirror of
https://github.com/a2nt/silverstripe-webpack.git
synced 2024-10-22 17:05:31 +02:00
Webpack 5 update + minor fixtures
This commit is contained in:
parent
5ddda5d91f
commit
850704705f
@ -7,7 +7,7 @@ After:
|
||||
SilverStripe\Core\Injector\Injector:
|
||||
A2nt\SilverStripeMapboxField\MarkerExtension:
|
||||
properties:
|
||||
geocoder: %$Symbiote\Addressable\MapboxGeocodeService
|
||||
geocoder: '%$Symbiote\Addressable\MapboxGeocodeService'
|
||||
Symbiote\Addressable\GeocodeServiceInterface:
|
||||
class: Symbiote\Addressable\MapboxGeocodeService
|
||||
|
||||
|
@ -33,7 +33,7 @@ SilverStripe\Core\Injector\Injector:
|
||||
SilverStripe\Assets\Storage\GeneratedAssetHandler.custom-generated-assets:
|
||||
class: SilverStripe\Assets\Flysystem\GeneratedAssets
|
||||
properties:
|
||||
Filesystem: %$League\Flysystem\Filesystem.custom-filesystem
|
||||
Filesystem: '%$League\Flysystem\Filesystem.custom-filesystem'
|
||||
# Assign this generator to the requirements builder
|
||||
SilverStripe\View\Requirements_Backend:
|
||||
properties:
|
||||
|
@ -24,6 +24,7 @@ class Notification extends DataObject
|
||||
'Content' => 'Text',
|
||||
'DateOn' => 'Date',
|
||||
'DateOff' => 'Date',
|
||||
'Area' => 'Enum("Site","Site")',
|
||||
];
|
||||
|
||||
private static $has_one = [
|
||||
|
@ -42,7 +42,6 @@
|
||||
"a2nt/silverstripe-mapboxfield": "dev-master",
|
||||
"a2nt/silverstripe-progressivewebapp": "dev-master",
|
||||
"bummzack/sortablefile": "*",
|
||||
"barryvdh/composer-cleanup-plugin": "0.2.x",
|
||||
"eluceo/ical": "^0.16.0",
|
||||
"ezyang/htmlpurifier": "^4.13",
|
||||
"showpro/silverstripe-seo-images": "^1.0",
|
||||
@ -70,6 +69,7 @@
|
||||
"project-files-installed": [
|
||||
"app/.htaccess",
|
||||
"app/_config.php",
|
||||
"app/_config/database.yml",
|
||||
"app/_config/mimevalidator.yml",
|
||||
"app/_config/mysite.yml",
|
||||
"app/src/Page.php",
|
||||
|
30
package.json
30
package.json
@ -13,10 +13,10 @@
|
||||
"yarn": ">= 1.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "cross-env NODE_ENV=development webpack-dev-server --https -d --config webpack.config.dev.js",
|
||||
"dash": "cross-env NODE_ENV=development webpack-dashboard -- webpack-dev-server --config webpack.config.dev.js",
|
||||
"prebuild": "rimraf app/client/dist",
|
||||
"build": "cross-env NODE_ENV=production webpack -p --config webpack.config.prod.js --progress",
|
||||
"start": "cross-env NODE_ENV=development webpack-dev-server --https --config webpack.config.serve.js",
|
||||
"dash": "cross-env NODE_ENV=development webpack-dashboard -- webpack-dev-server --config webpack.config.serve.js",
|
||||
"prebuild": "rimraf ./app/client/dist",
|
||||
"build": "cross-env NODE_ENV=production webpack --progress --stats-all",
|
||||
"lint:check": "eslint ./app/client/src --config .eslintrc && sass-lint ./app/client/src --config .sasslintrc -v -q",
|
||||
"lint:fix": "eslint ./app/client/src --config .eslintrc --fix && sass-lint ./app/client/src --config .sasslintrc -v -q --fix",
|
||||
"lint:js": "eslint ./app/client/src --config .eslintrc",
|
||||
@ -31,8 +31,8 @@
|
||||
"ie>=11"
|
||||
],
|
||||
"dependencies": {
|
||||
"@a2nt/meta-lightbox": "^2.7.1",
|
||||
"@a2nt/ss-bootstrap-ui-webpack-boilerplate": "^2.7.0",
|
||||
"@a2nt/meta-lightbox": "^2.4.0",
|
||||
"@a2nt/ss-bootstrap-ui-webpack-boilerplate": "^2.6.3",
|
||||
"aos": "^2.3.4",
|
||||
"bootbox": "^5.5.2",
|
||||
"bootstrap": "^4.5.3",
|
||||
@ -92,18 +92,14 @@
|
||||
"favicons-webpack-plugin": "^4.2.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"font-awesome": "^4.7.0",
|
||||
"hard-source-webpack-plugin": "^0.13.1",
|
||||
"hoist-non-react-statics": "^3.3.2",
|
||||
"html-entities": "^1.4.0",
|
||||
"html-webpack-plugin": "^4.5.0",
|
||||
"imagemin-gifsicle": "^7.0.0",
|
||||
"image-minimizer-webpack-plugin": "^2.1.0",
|
||||
"imagemin-jpegtran": "^7.0.0",
|
||||
"imagemin-optipng": "^8.0.0",
|
||||
"imagemin-svgo": "^8.0.0",
|
||||
"imagemin-webp": "^6.0.0",
|
||||
"img-optimize-loader": "^1.0.7",
|
||||
"loglevel": "^1.7.1",
|
||||
"mini-css-extract-plugin": "^0.12.0",
|
||||
"mini-css-extract-plugin": "^1.3.3",
|
||||
"node-sass": "^5.0.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"optimize-css-assets-webpack-plugin": "^5.0.4",
|
||||
@ -127,12 +123,12 @@
|
||||
"strip-ansi": "^6.0.0",
|
||||
"style-loader": "^2.0.0",
|
||||
"svg-url-loader": "^7.1.1",
|
||||
"terser-webpack-plugin": "^4.2.3",
|
||||
"terser-webpack-plugin": "^5.0.3",
|
||||
"url-loader": "^4.1.1",
|
||||
"webpack": "^4.44.2",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-dev-server": "^3.11.0",
|
||||
"webpack-manifest-plugin": "^2.2.0",
|
||||
"webpack": "^5.11.0",
|
||||
"webpack-cli": "^4.2.0",
|
||||
"webpack-dev-server": "^4.0.0-beta.0",
|
||||
"webpack-manifest-plugin": "^3.0.0",
|
||||
"webpack-merge": "^5.7.3"
|
||||
},
|
||||
"stylelint": {
|
||||
|
@ -1,22 +1,19 @@
|
||||
/*
|
||||
* Common Environment
|
||||
*/
|
||||
const UIInfo = require('./node_modules/@a2nt/ss-bootstrap-ui-webpack-boilerplate/package.json');
|
||||
console.log(
|
||||
'UI: ' +
|
||||
JSON.stringify(UIInfo.name) +
|
||||
' ver: ' +
|
||||
JSON.stringify(UIInfo.version),
|
||||
);
|
||||
|
||||
const webpack = require('webpack');
|
||||
const commonVariables = require('./webpack.configuration');
|
||||
const conf = commonVariables.configuration;
|
||||
|
||||
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
|
||||
const path = require('path');
|
||||
const filesystem = require('fs');
|
||||
|
||||
const UIInfo = require('./node_modules/@a2nt/ss-bootstrap-ui-webpack-boilerplate/package.json');
|
||||
const UINAME = JSON.stringify(UIInfo.name);
|
||||
const UIVERSION = JSON.stringify(UIInfo.version);
|
||||
console.info(`%cUI Kit ${UINAME} ${UIVERSION}`, 'color:yellow;font-size:14px');
|
||||
|
||||
const includes = {};
|
||||
const modules = [
|
||||
path.resolve(__dirname, conf.APPDIR, 'client', 'src'),
|
||||
@ -104,81 +101,16 @@ commonVariables.themes.forEach((theme) => {
|
||||
|
||||
module.exports = {
|
||||
entry: includes,
|
||||
devtool: 'source-map',
|
||||
externals: {
|
||||
jquery: 'jQuery',
|
||||
},
|
||||
optimization: {
|
||||
namedModules: true, // NamedModulesPlugin()
|
||||
splitChunks: {
|
||||
// CommonsChunkPlugin()
|
||||
name: 'vendor',
|
||||
minChunks: 2,
|
||||
},
|
||||
noEmitOnErrors: true, // NoEmitOnErrorsPlugin
|
||||
concatenateModules: true, //ModuleConcatenationPlugin
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
//exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-env'], //Preset used for env setup
|
||||
plugins: [
|
||||
['@babel/transform-react-jsx'],
|
||||
['react-hot-loader/babel'],
|
||||
],
|
||||
cacheDirectory: true,
|
||||
cacheCompression: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
/*{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.coffee?$/,
|
||||
use: 'coffee-loader',
|
||||
},*/
|
||||
{
|
||||
test: /\.worker\.js$/,
|
||||
use: {
|
||||
loader: 'worker-loader',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
modules: modules,
|
||||
alias: {
|
||||
'window.jQuery': require.resolve('jquery'),
|
||||
$: require.resolve('jquery'),
|
||||
jquery: require.resolve('jquery'),
|
||||
jQuery: require.resolve('jquery'),
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({
|
||||
$: 'jquery',
|
||||
jQuery: 'jquery',
|
||||
'window.jQuery': 'jquery',
|
||||
Popper: ['popper.js', 'default'],
|
||||
Util: 'exports-loader?Util!bootstrap/js/dist/util',
|
||||
Alert: 'exports-loader?Alert!bootstrap/js/dist/alert',
|
||||
Button: 'exports-loader?Button!bootstrap/js/dist/button',
|
||||
Carousel: 'exports-loader?Carousel!bootstrap/js/dist/carousel',
|
||||
Collapse: 'exports-loader?Collapse!bootstrap/js/dist/collapse',
|
||||
Dropdown: 'exports-loader?Dropdown!bootstrap/js/dist/dropdown',
|
||||
Modal: 'exports-loader?Modal!bootstrap/js/dist/modal',
|
||||
Tooltip: 'exports-loader?Tooltip!bootstrap/js/dist/tooltip',
|
||||
Popover: 'exports-loader?Popover!bootstrap/js/dist/popover',
|
||||
Scrollspy: 'exports-loader?Scrollspy!bootstrap/js/dist/scrollspy',
|
||||
Tab: 'exports-loader?Tab!bootstrap/js/dist/tab',
|
||||
}),
|
||||
new HardSourceWebpackPlugin(),
|
||||
],
|
||||
};
|
||||
|
@ -13,10 +13,10 @@
|
||||
"yarn": ">= 1.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "cross-env NODE_ENV=development webpack-dev-server --https --config webpack.config.serve.js",
|
||||
"dash": "cross-env NODE_ENV=development webpack-dashboard -- webpack-dev-server --config webpack.config.serve.js",
|
||||
"prebuild": "rimraf ./app/client/dist",
|
||||
"build": "cross-env NODE_ENV=production webpack --progress --stats-all",
|
||||
"start": "cross-env NODE_ENV=development webpack-dev-server --https -d --config webpack.config.dev.js",
|
||||
"dash": "cross-env NODE_ENV=development webpack-dashboard -- webpack-dev-server --config webpack.config.dev.js",
|
||||
"prebuild": "rimraf app/client/dist",
|
||||
"build": "cross-env NODE_ENV=production webpack -p --config webpack.config.prod.js --progress",
|
||||
"lint:check": "eslint ./app/client/src --config .eslintrc && sass-lint ./app/client/src --config .sasslintrc -v -q",
|
||||
"lint:fix": "eslint ./app/client/src --config .eslintrc --fix && sass-lint ./app/client/src --config .sasslintrc -v -q --fix",
|
||||
"lint:js": "eslint ./app/client/src --config .eslintrc",
|
||||
@ -31,8 +31,8 @@
|
||||
"ie>=11"
|
||||
],
|
||||
"dependencies": {
|
||||
"@a2nt/meta-lightbox": "^2.4.0",
|
||||
"@a2nt/ss-bootstrap-ui-webpack-boilerplate": "^2.6.3",
|
||||
"@a2nt/meta-lightbox": "^2.7.1",
|
||||
"@a2nt/ss-bootstrap-ui-webpack-boilerplate": "^2.7.0",
|
||||
"aos": "^2.3.4",
|
||||
"bootbox": "^5.5.2",
|
||||
"bootstrap": "^4.5.3",
|
||||
@ -92,14 +92,18 @@
|
||||
"favicons-webpack-plugin": "^4.2.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"font-awesome": "^4.7.0",
|
||||
"hard-source-webpack-plugin": "^0.13.1",
|
||||
"hoist-non-react-statics": "^3.3.2",
|
||||
"html-entities": "^1.4.0",
|
||||
"html-webpack-plugin": "^4.5.0",
|
||||
"image-minimizer-webpack-plugin": "^2.1.0",
|
||||
"imagemin-gifsicle": "^7.0.0",
|
||||
"imagemin-jpegtran": "^7.0.0",
|
||||
"imagemin-optipng": "^8.0.0",
|
||||
"imagemin-svgo": "^8.0.0",
|
||||
"imagemin-webp": "^6.0.0",
|
||||
"img-optimize-loader": "^1.0.7",
|
||||
"loglevel": "^1.7.1",
|
||||
"mini-css-extract-plugin": "^1.3.3",
|
||||
"mini-css-extract-plugin": "^0.12.0",
|
||||
"node-sass": "^5.0.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"optimize-css-assets-webpack-plugin": "^5.0.4",
|
||||
@ -123,12 +127,12 @@
|
||||
"strip-ansi": "^6.0.0",
|
||||
"style-loader": "^2.0.0",
|
||||
"svg-url-loader": "^7.1.1",
|
||||
"terser-webpack-plugin": "^5.0.3",
|
||||
"terser-webpack-plugin": "^4.2.3",
|
||||
"url-loader": "^4.1.1",
|
||||
"webpack": "^5.11.0",
|
||||
"webpack-cli": "^4.2.0",
|
||||
"webpack-dev-server": "^4.0.0-beta.0",
|
||||
"webpack-manifest-plugin": "^3.0.0",
|
||||
"webpack": "^4.44.2",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-dev-server": "^3.11.0",
|
||||
"webpack-manifest-plugin": "^2.2.0",
|
||||
"webpack-merge": "^5.7.3"
|
||||
},
|
||||
"stylelint": {
|
@ -1,19 +1,22 @@
|
||||
/*
|
||||
* Common Environment
|
||||
*/
|
||||
const UIInfo = require('./node_modules/@a2nt/ss-bootstrap-ui-webpack-boilerplate/package.json');
|
||||
console.log(
|
||||
'UI: ' +
|
||||
JSON.stringify(UIInfo.name) +
|
||||
' ver: ' +
|
||||
JSON.stringify(UIInfo.version),
|
||||
);
|
||||
|
||||
const webpack = require('webpack');
|
||||
const commonVariables = require('./webpack.configuration');
|
||||
const conf = commonVariables.configuration;
|
||||
|
||||
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
|
||||
const path = require('path');
|
||||
const filesystem = require('fs');
|
||||
|
||||
const UIInfo = require('./node_modules/@a2nt/ss-bootstrap-ui-webpack-boilerplate/package.json');
|
||||
const UINAME = JSON.stringify(UIInfo.name);
|
||||
const UIVERSION = JSON.stringify(UIInfo.version);
|
||||
console.info(`%cUI Kit ${UINAME} ${UIVERSION}`, 'color:yellow;font-size:14px');
|
||||
|
||||
const includes = {};
|
||||
const modules = [
|
||||
path.resolve(__dirname, conf.APPDIR, 'client', 'src'),
|
||||
@ -101,16 +104,81 @@ commonVariables.themes.forEach((theme) => {
|
||||
|
||||
module.exports = {
|
||||
entry: includes,
|
||||
devtool: 'source-map',
|
||||
externals: {
|
||||
jquery: 'jQuery',
|
||||
},
|
||||
optimization: {
|
||||
namedModules: true, // NamedModulesPlugin()
|
||||
splitChunks: {
|
||||
// CommonsChunkPlugin()
|
||||
name: 'vendor',
|
||||
minChunks: 2,
|
||||
},
|
||||
noEmitOnErrors: true, // NoEmitOnErrorsPlugin
|
||||
concatenateModules: true, //ModuleConcatenationPlugin
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
//exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-env'], //Preset used for env setup
|
||||
plugins: [
|
||||
['@babel/transform-react-jsx'],
|
||||
['react-hot-loader/babel'],
|
||||
],
|
||||
cacheDirectory: true,
|
||||
cacheCompression: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
/*{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.coffee?$/,
|
||||
use: 'coffee-loader',
|
||||
},*/
|
||||
{
|
||||
test: /\.worker\.js$/,
|
||||
use: {
|
||||
loader: 'worker-loader',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
modules: modules,
|
||||
alias: {
|
||||
'window.jQuery': require.resolve('jquery'),
|
||||
$: require.resolve('jquery'),
|
||||
jquery: require.resolve('jquery'),
|
||||
jQuery: require.resolve('jquery'),
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({
|
||||
$: 'jquery',
|
||||
jQuery: 'jquery',
|
||||
'window.jQuery': 'jquery',
|
||||
Popper: ['popper.js', 'default'],
|
||||
Util: 'exports-loader?Util!bootstrap/js/dist/util',
|
||||
Alert: 'exports-loader?Alert!bootstrap/js/dist/alert',
|
||||
Button: 'exports-loader?Button!bootstrap/js/dist/button',
|
||||
Carousel: 'exports-loader?Carousel!bootstrap/js/dist/carousel',
|
||||
Collapse: 'exports-loader?Collapse!bootstrap/js/dist/collapse',
|
||||
Dropdown: 'exports-loader?Dropdown!bootstrap/js/dist/dropdown',
|
||||
Modal: 'exports-loader?Modal!bootstrap/js/dist/modal',
|
||||
Tooltip: 'exports-loader?Tooltip!bootstrap/js/dist/tooltip',
|
||||
Popover: 'exports-loader?Popover!bootstrap/js/dist/popover',
|
||||
Scrollspy: 'exports-loader?Scrollspy!bootstrap/js/dist/scrollspy',
|
||||
Tab: 'exports-loader?Tab!bootstrap/js/dist/tab',
|
||||
}),
|
||||
new HardSourceWebpackPlugin(),
|
||||
],
|
||||
};
|
0
webpack.config.dev.js → webpack4/webpack.config.dev.js
Executable file → Normal file
0
webpack.config.dev.js → webpack4/webpack.config.dev.js
Executable file → Normal file
0
webpack.config.prod.js → webpack4/webpack.config.prod.js
Executable file → Normal file
0
webpack.config.prod.js → webpack4/webpack.config.prod.js
Executable file → Normal file
Loading…
Reference in New Issue
Block a user