Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
chore: fix webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpza committed Oct 24, 2018
1 parent c7d56c6 commit 5573f39
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 4 deletions.
65 changes: 65 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@
"@types/node": "^9.6.0",
"@types/selenium-webdriver": "^3.0.10",
"@types/webpack": "^4.4.17",
"copy-webpack-plugin": "^4.5.4",
"css-loader": "^1.0.0",
"expect": "^23.6.0",
"express": "^4.16.3",
"html-webpack-include-assets-plugin": "^1.0.6",
"html-webpack-plugin": "^3.2.0",
"husky": "^1.1.1",
"lynt": "^0.5.3",
Expand Down
13 changes: 9 additions & 4 deletions test/automate/setup/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import CopyWebpackPlugin from "copy-webpack-plugin"
import HtmlWebpackIncludeAssetsPlugin from "html-webpack-include-assets-plugin"
import HtmlWebpackPlugin from "html-webpack-plugin"
import * as http from "http"
import express = require("express")
Expand All @@ -7,14 +9,13 @@ import webpack from "webpack"
class Server {
private root = resolve(__dirname, "../../../")
private outDir = resolve(__dirname, "_static")
private bundleName = "bundle.js"
private server: http.Server = (null as any) as http.Server
public async generateFiles() {
const compiler = webpack({
mode: "production",
entry: [resolve(this.root, "src/browser.ts"), resolve(this.root, "test/local/index.css")],
entry: resolve(this.root, "src/browser.ts"),
output: {
filename: this.bundleName,
filename: "[name].js",
path: this.outDir,
library: "ScrollUtility",
libraryTarget: "umd",
Expand All @@ -41,7 +42,11 @@ class Server {
resolve: {
extensions: [".ts", ".tsx", ".js"],
},
plugins: [new HtmlWebpackPlugin({ template: resolve(this.root, "test/local/index.html") })],
plugins: [
new HtmlWebpackPlugin({ template: resolve(this.root, "test/local/index.html") }),
new CopyWebpackPlugin([resolve(this.root, "test/local/index.css")]),
new HtmlWebpackIncludeAssetsPlugin({ assets: ["./index.css"], append: false }),
],
})
return new Promise<void>((s, r) => {
compiler.run(err => {
Expand Down

0 comments on commit 5573f39

Please sign in to comment.