Update build
This commit is contained in:
parent
34f9e69bff
commit
e7641e38d8
463
js/package-lock.json
generated
463
js/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -20,6 +20,7 @@ const fs = require('fs');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const flatten = require('lodash.flatten');
|
const flatten = require('lodash.flatten');
|
||||||
// const ReactIntlAggregatePlugin = require('react-intl-aggregate-webpack-plugin');
|
// const ReactIntlAggregatePlugin = require('react-intl-aggregate-webpack-plugin');
|
||||||
|
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||||
const WebpackErrorNotificationPlugin = require('webpack-error-notification');
|
const WebpackErrorNotificationPlugin = require('webpack-error-notification');
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
@ -83,50 +84,56 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
test: /\.css$/,
|
test: /\.css$/,
|
||||||
include: /semantic-ui-css/,
|
include: /semantic-ui-css/,
|
||||||
use: [
|
use: ExtractTextPlugin.extract({
|
||||||
'style-loader',
|
fallback: 'style-loader',
|
||||||
{
|
use: [
|
||||||
loader: 'css-loader',
|
{
|
||||||
options: {
|
loader: 'css-loader',
|
||||||
minimize: true
|
options: {
|
||||||
|
minimize: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
]
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.css$/,
|
test: /\.css$/,
|
||||||
exclude: /semantic-ui-css/,
|
exclude: /semantic-ui-css/,
|
||||||
use: [
|
use: ExtractTextPlugin.extract({
|
||||||
'style-loader',
|
fallback: 'style-loader',
|
||||||
{
|
use: [
|
||||||
loader: 'css-loader',
|
{
|
||||||
options: {
|
loader: 'css-loader',
|
||||||
importLoaders: 1,
|
options: {
|
||||||
localIdentName: '[name]_[local]_[hash:base64:10]',
|
importLoaders: 1,
|
||||||
minimize: true,
|
localIdentName: '[name]_[local]_[hash:base64:10]',
|
||||||
modules: true
|
minimize: true,
|
||||||
|
modules: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
loader: 'postcss-loader',
|
||||||
|
options: {
|
||||||
|
sourceMap: true,
|
||||||
|
plugins: [
|
||||||
|
require('postcss-import'),
|
||||||
|
require('postcss-nested'),
|
||||||
|
require('postcss-simple-vars')
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
]
|
||||||
{
|
})
|
||||||
loader: 'postcss-loader',
|
|
||||||
options: {
|
|
||||||
sourceMap: true,
|
|
||||||
plugins: [
|
|
||||||
require('postcss-import'),
|
|
||||||
require('postcss-nested'),
|
|
||||||
require('postcss-simple-vars')
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.(png|jpg|svg|woff|woff2|ttf|eot|otf)(\?.*)?$/,
|
test: /\.(png|jpg|svg|woff|woff2|ttf|eot|otf)(\?.*)?$/,
|
||||||
use: {
|
use: {
|
||||||
loader: 'file-loader',
|
loader: 'file-loader',
|
||||||
options: {
|
options: {
|
||||||
name: '[name].[hash:base64:10].[ext]',
|
name: '[name].[hash:10].[ext]',
|
||||||
useRelativePath: true
|
outputPath: '',
|
||||||
|
publicPath: '',
|
||||||
|
useRelativePath: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -153,7 +160,10 @@ module.exports = {
|
|||||||
|
|
||||||
plugins: (function () {
|
plugins: (function () {
|
||||||
let plugins = Shared.getPlugins().concat(
|
let plugins = Shared.getPlugins().concat(
|
||||||
new WebpackErrorNotificationPlugin()
|
new WebpackErrorNotificationPlugin(),
|
||||||
|
new ExtractTextPlugin({
|
||||||
|
filename: `${isEmbed ? 'embed' : 'bundle'}.css`
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!isEmbed) {
|
if (!isEmbed) {
|
||||||
@ -187,16 +197,13 @@ module.exports = {
|
|||||||
? dapp.id
|
? dapp.id
|
||||||
: Api.util.sha3(dapp.url);
|
: Api.util.sha3(dapp.url);
|
||||||
|
|
||||||
return [
|
return ['index.html', 'dist.css', 'dist.css.map', 'dist.js', 'dist.js.map'].map((file) => ({
|
||||||
{
|
from: path.join(dir, file),
|
||||||
from: path.join(dir, 'dist'),
|
to: `dapps/${destination}/`
|
||||||
to: `dapps/${destination}/dist/`
|
})).concat({
|
||||||
},
|
from: path.join(dir, 'dist'),
|
||||||
{
|
to: `dapps/${destination}/dist/`
|
||||||
from: path.join(dir, 'index.html'),
|
});
|
||||||
to: `dapps/${destination}/`
|
|
||||||
}
|
|
||||||
];
|
|
||||||
})
|
})
|
||||||
.filter((copy) => copy)
|
.filter((copy) => copy)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user