A webpack plugin that produces minimal ExtReact and Ext JS bundles containing only those components used in your app.
This Webpack plugin produces a minimized build of the Sencha Ext JS framework containing only those classes used by your React app. Use with the react-extjs custom renderer for React.
The ExtReactWebpackPlugin adds assets to the webpack build (ext.js and ext.css). As a result it needs to appear before HtmlWebpackPlugin in the webpack config's plugins array.
/\.jsx?$/production is set to false. Defaults to true.``javascript
'use strict';
const path = require('path');
const webpack = require('webpack');
const ExtReactWebpackPlugin = require('@extjs/reactor-webpack-plugin');
module.exports = {
devtool: 'inline-source-map',
entry: [
'./src/index'
],
output: {
path: path.join(__dirname, 'build'),
filename: 'index.js'
},
plugins: [
new ExtReactWebpackPlugin({
toolkit: 'modern',
sdk: 'ext',
theme: 'theme-material',
packages: ['ux', 'calendar']
})
],
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
include: [
path.join(__dirname, 'src')
]
},
{
test: /\.css$/,
loader: 'style!css'
},
{
test: /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)(\?.*)?$/,
exclude: /\/favicon.ico$/,
loader: 'file',
query: {
name: 'static/media/[name].[hash:8].[ext]'
}
}
]
}
};
``