aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs-example/webpack.config.js
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-19 03:14:02 +0800
committerFabio Berger <me@fabioberger.com>2018-03-19 03:14:02 +0800
commit82b0ff6008415fac4d509d4e2e91b17d11cb0079 (patch)
tree6be7db86e35691e4c663cfb324ff59b43ae3f7db /packages/react-docs-example/webpack.config.js
parenta691de7d55d2f712a9601dd2440f155fcb0a9a14 (diff)
parentcc4e390c91da86778c6d1492d55591a783af3152 (diff)
downloaddexon-0x-contracts-82b0ff6008415fac4d509d4e2e91b17d11cb0079.tar
dexon-0x-contracts-82b0ff6008415fac4d509d4e2e91b17d11cb0079.tar.gz
dexon-0x-contracts-82b0ff6008415fac4d509d4e2e91b17d11cb0079.tar.bz2
dexon-0x-contracts-82b0ff6008415fac4d509d4e2e91b17d11cb0079.tar.lz
dexon-0x-contracts-82b0ff6008415fac4d509d4e2e91b17d11cb0079.tar.xz
dexon-0x-contracts-82b0ff6008415fac4d509d4e2e91b17d11cb0079.tar.zst
dexon-0x-contracts-82b0ff6008415fac4d509d4e2e91b17d11cb0079.zip
Merge branch 'development'
* development: (269 commits) Make new packages default to public on publish Add new public packages to top-level README Update top-level package.json Fix incorrect new versions Fix path to assets Publish Updated CHANGELOGS Fix quotation marks Add a complex test for ast visitor Move opcodes to constants Fix issue with bundling subproviders for the browser by ignoring the `ganache-core` dependency Add changelog entry about pragma addition Add pragma above command-line script Add tests for sol-cov Updated CHANGELOGs Add SignedOrder, Order, and ECSignature types to the types package Keep console.log in monorepo-scripts Enable coverage for all other packages with tests Fix parallel coverage results reporting Fix linter issuesx ...
Diffstat (limited to 'packages/react-docs-example/webpack.config.js')
-rw-r--r--packages/react-docs-example/webpack.config.js83
1 files changed, 83 insertions, 0 deletions
diff --git a/packages/react-docs-example/webpack.config.js b/packages/react-docs-example/webpack.config.js
new file mode 100644
index 000000000..30f3132da
--- /dev/null
+++ b/packages/react-docs-example/webpack.config.js
@@ -0,0 +1,83 @@
+const path = require('path');
+const webpack = require('webpack');
+
+module.exports = {
+ entry: ['./ts/index.tsx'],
+ output: {
+ path: path.join(__dirname, '/public'),
+ filename: 'bundle.js',
+ chunkFilename: 'bundle-[name].js',
+ publicPath: '/',
+ },
+ devtool: 'source-map',
+ resolve: {
+ modules: [path.join(__dirname, '/ts'), 'node_modules'],
+ extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '.md'],
+ alias: {
+ ts: path.join(__dirname, '/ts'),
+ less: path.join(__dirname, '/less'),
+ md: path.join(__dirname, '/md'),
+ },
+ },
+ module: {
+ rules: [
+ {
+ test: /\.js$/,
+ loader: 'source-map-loader',
+ exclude: [
+ // instead of /\/node_modules\//
+ path.join(process.cwd(), 'node_modules'),
+ ],
+ },
+ {
+ test: /\.tsx?$/,
+ loader: 'awesome-typescript-loader',
+ },
+ {
+ test: /\.css$/,
+ loaders: ['style-loader', 'css-loader'],
+ },
+ {
+ test: /\.less$/,
+ loader: 'style-loader!css-loader!less-loader',
+ exclude: /node_modules/,
+ },
+ {
+ test: /\.json$/,
+ loader: 'json-loader',
+ },
+ {
+ test: /\.md$/,
+ use: 'raw-loader',
+ },
+ ],
+ },
+ devServer: {
+ port: 3000,
+ disableHostCheck: true,
+ historyApiFallback: {
+ // Fixes issue where having dots in URL path that aren't part of fileNames causes webpack-dev-server
+ // to fail.
+ // Source: https://github.com/cvut/fittable/issues/171
+ rewrites: [
+ {
+ from: /.*$/,
+ to: function() {
+ return 'index.html';
+ },
+ },
+ ],
+ },
+ contentBase: path.join(__dirname, '/public'),
+ },
+ plugins:
+ process.env.NODE_ENV === 'production'
+ ? [
+ new webpack.DefinePlugin({
+ 'process.env': {
+ NODE_ENV: JSON.stringify(process.env.NODE_ENV),
+ },
+ }),
+ ]
+ : [],
+};