-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
52 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
dist/ | ||
dist/ | ||
lib/ |
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
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 |
---|---|---|
@@ -1,44 +1,51 @@ | ||
const path = require('path'); | ||
const HTMLPlugin = require('html-webpack-plugin'); | ||
/** | ||
* @file | ||
* | ||
* This file contains configuration to run the demo locally. | ||
*/ | ||
const path = require("path"); | ||
const HTMLPlugin = require("html-webpack-plugin"); | ||
|
||
module.exports = { | ||
entry: './entry.ts', | ||
mode: 'development', | ||
devtool: 'inline-source-map', | ||
entry: "./src/demo", | ||
mode: "development", | ||
devtool: "inline-source-map", | ||
module: { | ||
rules: [ | ||
// source maps from typescript work | ||
{ test: /\.js$/, loader: 'source-map-loader', enforce: 'pre' }, | ||
{ test: /\.js$/, loader: "source-map-loader", enforce: "pre" }, | ||
|
||
// load typescript outside of node_modules | ||
{ | ||
test: /\.tsx?$/, | ||
use: 'ts-loader', | ||
test: /\.ts$/, | ||
use: "ts-loader", | ||
exclude: /node_modules/ | ||
}, | ||
// load stylesheets -- only needed for development | ||
{ | ||
test: /\.css$/, loader: ['style-loader', 'css-loader'] | ||
}, | ||
test: /\.css$/, | ||
loader: ["style-loader", "css-loader"] | ||
}, | ||
|
||
// load png images -- only needed for development | ||
// load png images -- only needed for development | ||
{ | ||
test: /\.(png|jpg|gif)$/, | ||
loader: 'url-loader' | ||
loader: "url-loader" | ||
} | ||
] | ||
}, | ||
resolve: { | ||
extensions: [ '.tsx', '.ts', '.js' ] | ||
extensions: [".ts", ".js"] | ||
}, | ||
output: { | ||
// library: 'tgview', | ||
// libraryTarget: 'umd', | ||
filename: 'bundle.js', | ||
path: path.resolve(__dirname, 'dist'), | ||
devtoolModuleFilenameTemplate: '[absolute-resource-path]' | ||
filename: '[name].bundle.js', | ||
path: path.resolve(__dirname, "dist"), | ||
devtoolModuleFilenameTemplate: "[absolute-resource-path]" | ||
}, | ||
optimization: { | ||
splitChunks: { | ||
chunks: "all" | ||
} | ||
}, | ||
plugins: [ | ||
new HTMLPlugin() | ||
] | ||
plugins: [new HTMLPlugin()] | ||
}; |