pull/3397/head
filip mertens 2 years ago
parent c82da43846
commit f278242287
  1. 16
      apps/etherscan/.babelrc
  2. 104
      apps/etherscan/webpack.config.js
  3. 2
      apps/remix-ide-e2e/src/local-plugin/project.json
  4. 82
      apps/remix-ide-e2e/src/local-plugin/webpack.config.js
  5. 108
      apps/vyper/webpack.config.js

@ -1,13 +1,9 @@
{ {
"presets": [ "presets": ["@babel/preset-env", ["@babel/preset-react",
[ {"runtime": "automatic"}
"@nrwl/react/babel", { ]],
"runtime": "automatic" "plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-transform-runtime", "@babel/plugin-proposal-nullish-coalescing-operator"],
"ignore": [
} "**/node_modules/**"
]
],
"plugins": [
] ]
} }

@ -1,28 +1,82 @@
const nxWebpack = require('@nrwl/react/plugins/webpack') const { composePlugins, withNx } = require('@nrwl/webpack')
const webpack = require('webpack')
module.exports = config => { const TerserPlugin = require("terser-webpack-plugin")
const nxWebpackConfig = nxWebpack(config) const CssMinimizerPlugin = require("css-minimizer-webpack-plugin")
const webpackConfig = {
...nxWebpackConfig, // Nx plugins for webpack.
resolve : { module.exports = composePlugins(withNx(), (config) => {
...nxWebpackConfig.resolve, // Update the webpack config as needed here.
fallback: { // e.g. `config.plugins.push(new MyPlugin())`
...nxWebpackConfig.resolve.fallback,
"http": require.resolve("stream-http"), // add fallback for node modules
"https": require.resolve("https-browserify"), config.resolve.fallback = {
"stream": require.resolve("stream-browserify"), ...config.resolve.fallback,
"zlib": require.resolve("browserify-zlib"), "crypto": require.resolve("crypto-browserify"),
}, "stream": require.resolve("stream-browserify"),
} "path": require.resolve("path-browserify"),
"http": require.resolve("stream-http"),
"https": require.resolve("https-browserify"),
"constants": require.resolve("constants-browserify"),
"os": false, //require.resolve("os-browserify/browser"),
"timers": false, // require.resolve("timers-browserify"),
"zlib": require.resolve("browserify-zlib"),
"fs": false,
"module": false,
"tls": false,
"net": false,
"readline": false,
"child_process": false,
"buffer": require.resolve("buffer/"),
"vm": require.resolve('vm-browserify'),
} }
if (process.env.NODE_ENV === 'production') { // add externals
return { config.externals = {
...webpackConfig, ...config.externals,
mode: 'production', solc: 'solc',
devtool: 'source-map',
}
} else {
return webpackConfig
} }
}
// add public path
config.output.publicPath = '/'
// add copy & provide plugin
config.plugins.push(
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
url: ['url', 'URL'],
process: 'process/browser',
})
)
// souce-map loader
config.module.rules.push({
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre"
})
config.ignoreWarnings = [/Failed to parse source map/] // ignore source-map-loader warnings
// set minimizer
config.optimization.minimizer = [
new TerserPlugin({
parallel: true,
terserOptions: {
ecma: 2015,
compress: false,
mangle: false,
format: {
comments: false,
},
},
extractComments: false,
}),
new CssMinimizerPlugin(),
];
return config;
});

@ -25,7 +25,7 @@
"apps/remix-ide-e2e/src/local-plugin/src/styles.css" "apps/remix-ide-e2e/src/local-plugin/src/styles.css"
], ],
"scripts": [], "scripts": [],
"webpackConfig": "@nrwl/react/plugins/webpack" "webpackConfig": "apps/remix-ide-e2e/src/local-plugin/webpack.config.js"
}, },
"configurations": { "configurations": {
"development": { "development": {

@ -0,0 +1,82 @@
const { composePlugins, withNx } = require('@nrwl/webpack')
const webpack = require('webpack')
const TerserPlugin = require("terser-webpack-plugin")
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin")
// Nx plugins for webpack.
module.exports = composePlugins(withNx(), (config) => {
// Update the webpack config as needed here.
// e.g. `config.plugins.push(new MyPlugin())`
// add fallback for node modules
config.resolve.fallback = {
...config.resolve.fallback,
"crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"),
"path": require.resolve("path-browserify"),
"http": require.resolve("stream-http"),
"https": require.resolve("https-browserify"),
"constants": require.resolve("constants-browserify"),
"os": false, //require.resolve("os-browserify/browser"),
"timers": false, // require.resolve("timers-browserify"),
"zlib": require.resolve("browserify-zlib"),
"fs": false,
"module": false,
"tls": false,
"net": false,
"readline": false,
"child_process": false,
"buffer": require.resolve("buffer/"),
"vm": require.resolve('vm-browserify'),
}
// add externals
config.externals = {
...config.externals,
solc: 'solc',
}
// add public path
config.output.publicPath = '/'
// add copy & provide plugin
config.plugins.push(
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
url: ['url', 'URL'],
process: 'process/browser',
})
)
// souce-map loader
config.module.rules.push({
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre"
})
config.ignoreWarnings = [/Failed to parse source map/] // ignore source-map-loader warnings
// set minimizer
config.optimization.minimizer = [
new TerserPlugin({
parallel: true,
terserOptions: {
ecma: 2015,
compress: false,
mangle: false,
format: {
comments: false,
},
},
extractComments: false,
}),
new CssMinimizerPlugin(),
];
return config;
});

@ -1,31 +1,83 @@
const nxWebpack = require('@nrwl/react/plugins/webpack') const { composePlugins, withNx } = require('@nrwl/webpack')
const webpack = require('webpack')
module.exports = config => { const TerserPlugin = require("terser-webpack-plugin")
const nxWebpackConfig = nxWebpack(config) const CssMinimizerPlugin = require("css-minimizer-webpack-plugin")
const webpackConfig = {
...nxWebpackConfig,
resolve : { // Nx plugins for webpack.
...nxWebpackConfig.resolve, module.exports = composePlugins(withNx(), (config) => {
fallback: { // Update the webpack config as needed here.
...nxWebpackConfig.resolve.fallback, // e.g. `config.plugins.push(new MyPlugin())`
"crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"), // add fallback for node modules
"http" : require.resolve("stream-http"), config.resolve.fallback = {
"https" : require.resolve("https-browserify"), ...config.resolve.fallback,
"path" : require.resolve("path-browserify"), "crypto": require.resolve("crypto-browserify"),
"module": false, "stream": require.resolve("stream-browserify"),
"fs" : false "path": require.resolve("path-browserify"),
}, "http": require.resolve("stream-http"),
} "https": require.resolve("https-browserify"),
"constants": require.resolve("constants-browserify"),
"os": false, //require.resolve("os-browserify/browser"),
"timers": false, // require.resolve("timers-browserify"),
"zlib": require.resolve("browserify-zlib"),
"fs": false,
"module": false,
"tls": false,
"net": false,
"readline": false,
"child_process": false,
"buffer": require.resolve("buffer/"),
"vm": require.resolve('vm-browserify'),
} }
if (process.env.NODE_ENV === 'production') { // add externals
return { config.externals = {
...webpackConfig, ...config.externals,
mode: 'production', solc: 'solc',
devtool: 'source-map',
}
} else {
return webpackConfig
} }
}
// add public path
config.output.publicPath = '/'
// add copy & provide plugin
config.plugins.push(
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
url: ['url', 'URL'],
process: 'process/browser',
})
)
// souce-map loader
config.module.rules.push({
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre"
})
config.ignoreWarnings = [/Failed to parse source map/] // ignore source-map-loader warnings
// set minimizer
config.optimization.minimizer = [
new TerserPlugin({
parallel: true,
terserOptions: {
ecma: 2015,
compress: false,
mangle: false,
format: {
comments: false,
},
},
extractComments: false,
}),
new CssMinimizerPlugin(),
];
return config;
});

Loading…
Cancel
Save