-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure library and demo for production builds
- Loading branch information
1 parent
4d72b15
commit 4035bdd
Showing
13 changed files
with
148 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
const HtmlWebpackPlugin = require("html-webpack-plugin"); | ||
const path = require("path"); | ||
|
||
module.exports = { | ||
entry: path.resolve(__dirname, "src/index.tsx"), | ||
output: { | ||
path: path.resolve(__dirname, "dist"), | ||
filename: "index.bundle.js", | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.([jt]sx?)$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: "babel-loader", | ||
options: { | ||
presets: [ | ||
"@babel/preset-env", | ||
"@babel/preset-typescript", | ||
"@babel/preset-react", | ||
], | ||
}, | ||
}, | ||
}, | ||
{ | ||
test: /\.css$/i, | ||
use: ["style-loader", "css-loader"], | ||
}, | ||
{ test: /\.json$/, type: "json" }, | ||
], | ||
}, | ||
externals: { | ||
fs: "fs", | ||
}, | ||
externalsType: "window", | ||
plugins: [ | ||
new HtmlWebpackPlugin({ | ||
title: "MemoryViz Demo", | ||
filename: "./index.html", | ||
template: "./src/html/index.html", | ||
}), | ||
], | ||
resolve: { | ||
extensions: [".ts", ".tsx", ".js", ".jsx", ".json", ".css"], | ||
alias: { | ||
"memory-viz": path.resolve(__dirname, "../memory-viz/src"), | ||
}, | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const { merge } = require("webpack-merge"); | ||
const common = require("./webpack.common.js"); | ||
|
||
module.exports = merge(common, { | ||
mode: "development", | ||
devtool: "inline-source-map", | ||
devServer: { | ||
static: { | ||
directory: path.join(__dirname, "dist"), | ||
}, | ||
compress: true, | ||
port: 9000, | ||
client: { | ||
overlay: false, | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const { merge } = require("webpack-merge"); | ||
const common = require("./webpack.common.js"); | ||
|
||
module.exports = merge(common, { | ||
mode: "production", | ||
devtool: "source-map", | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const path = require("path"); | ||
|
||
module.exports = { | ||
// target: "web", | ||
entry: path.resolve(__dirname, "src/index.ts"), | ||
output: { | ||
path: path.resolve(__dirname, "dist"), | ||
filename: "memory_viz.bundle.js", | ||
library: { | ||
name: "MemoryViz", | ||
type: "umd", | ||
export: "default", | ||
}, | ||
globalObject: "this", | ||
clean: true, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.([jt]s)$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: "babel-loader", | ||
options: { | ||
presets: [ | ||
"@babel/preset-env", | ||
"@babel/preset-typescript", | ||
], | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
externals: { | ||
fs: "fs", | ||
}, | ||
resolve: { | ||
extensions: [".ts", ".js"], | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const { merge } = require("webpack-merge"); | ||
const common = require("./webpack.common.js"); | ||
|
||
module.exports = merge(common, { | ||
mode: "development", | ||
devtool: "inline-source-map", | ||
devServer: { | ||
static: "./dist", | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const { merge } = require("webpack-merge"); | ||
const common = require("./webpack.common.js"); | ||
|
||
module.exports = merge(common, { | ||
mode: "production", | ||
devtool: "source-map", | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.