update Webpack to 2.2

This commit is contained in:
alecmerdler 2017-02-06 14:05:19 -08:00
parent c5441923f7
commit 75d203c478
4 changed files with 15 additions and 17 deletions

View file

@ -77,7 +77,7 @@ RUN chmod +x /usr/local/bin/jwtproxy
RUN curl -L -o /usr/local/bin/prometheus-aggregator https://github.com/coreos/prometheus-aggregator/releases/download/v0.0.1-alpha/prometheus-aggregator RUN curl -L -o /usr/local/bin/prometheus-aggregator https://github.com/coreos/prometheus-aggregator/releases/download/v0.0.1-alpha/prometheus-aggregator
RUN chmod +x /usr/local/bin/prometheus-aggregator RUN chmod +x /usr/local/bin/prometheus-aggregator
# Install Webpack, Typescript, React # Install Webpack, Typescript
RUN ln -s /usr/bin/nodejs /usr/bin/node RUN ln -s /usr/bin/nodejs /usr/bin/node
ADD package.json package.json ADD package.json package.json
ADD tsconfig.json tsconfig.json ADD tsconfig.json tsconfig.json
@ -88,11 +88,9 @@ RUN npm link typescript
# Add static files # Add static files
ADD static static ADD static static
ADD static/js/directives/components static/dist/components
# Run Webpack # Run Webpack
RUN npm install -g webpack RUN node_modules/.bin/webpack --progress
RUN webpack
# Run front-end tests # Run front-end tests
ARG RUN_TESTS=true ARG RUN_TESTS=true

View file

@ -59,6 +59,6 @@
"ts-loader": "0.9.5", "ts-loader": "0.9.5",
"typescript": "2.0.3", "typescript": "2.0.3",
"typings": "1.4.0", "typings": "1.4.0",
"webpack": "1.13.3" "webpack": "^2.2"
} }
} }

View file

@ -34,7 +34,7 @@ class body extends React.Component<IBody, IBodyState> {
}; };
} }
componentDidMount() { componentDidMount() {
let intervalId: number = setInterval(() => this.getBuilds(), 1000); let intervalId: number = window.setInterval(() => this.getBuilds(), 1000);
this.setState({ this.setState({
currentBuild: this.state.currentBuild, currentBuild: this.state.currentBuild,
intervalId: intervalId intervalId: intervalId
@ -65,7 +65,7 @@ class body extends React.Component<IBody, IBodyState> {
trigger_metadata: element.trigger_metadata trigger_metadata: element.trigger_metadata
}); });
}); });
this.setState({ this.setState({
currentBuild: builds, currentBuild: builds,
intervalId: this.state.intervalId intervalId: this.state.intervalId
@ -92,7 +92,7 @@ class body extends React.Component<IBody, IBodyState> {
<div className="tab-pane in active" id="tab1"> <div className="tab-pane in active" id="tab1">
<div className="rp-description">{description}</div> <div className="rp-description">{description}</div>
</div> </div>
<div className="tab-pane" id="tab2"> <div className="tab-pane" id="tab2">
<div className="panel-body"> <div className="panel-body">
<h3 className="tab-header">Repository Builds</h3> <h3 className="tab-header">Repository Builds</h3>
<Build data={this.state.currentBuild}/> <Build data={this.state.currentBuild}/>

View file

@ -8,17 +8,17 @@ var config = {
filename: "bundle.js" filename: "bundle.js"
}, },
resolve: { resolve: {
extensions: ["", ".ts", ".tsx", ".js", ".scss"], extensions: [".ts", ".tsx", ".js", ".scss"],
alias: { alias: {
"sass": path.resolve('./static/css/directives/components/pages/') sass: path.resolve(__dirname, 'static/css/directives/components/pages/')
} }
}, },
// Use window.angular to maintain compatibility with non-Webpack components // Use window.angular to maintain compatibility with non-Webpack components
externals: { externals: {
"angular": "angular", angular: "angular",
}, },
module: { module: {
loaders: [ rules: [
{ {
test: /\.tsx?$/, test: /\.tsx?$/,
loader: "ts-loader", loader: "ts-loader",
@ -26,13 +26,13 @@ var config = {
}, },
{ {
test: /\.scss$/, test: /\.scss$/,
loaders: ['style', 'css', 'sass'], use: [
"style-loader",
"css-loader",
"sass-loader",
],
exclude: /node_modules/ exclude: /node_modules/
}, },
{
test: /angular\.js$/,
loader: 'expose?angular',
}
] ]
}, },
devtool: "source-map", devtool: "source-map",