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 chmod +x /usr/local/bin/prometheus-aggregator
# Install Webpack, Typescript, React
# Install Webpack, Typescript
RUN ln -s /usr/bin/nodejs /usr/bin/node
ADD package.json package.json
ADD tsconfig.json tsconfig.json
@ -88,11 +88,9 @@ RUN npm link typescript
# Add static files
ADD static static
ADD static/js/directives/components static/dist/components
# Run Webpack
RUN npm install -g webpack
RUN webpack
RUN node_modules/.bin/webpack --progress
# Run front-end tests
ARG RUN_TESTS=true

View file

@ -59,6 +59,6 @@
"ts-loader": "0.9.5",
"typescript": "2.0.3",
"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() {
let intervalId: number = setInterval(() => this.getBuilds(), 1000);
let intervalId: number = window.setInterval(() => this.getBuilds(), 1000);
this.setState({
currentBuild: this.state.currentBuild,
intervalId: intervalId
@ -65,7 +65,7 @@ class body extends React.Component<IBody, IBodyState> {
trigger_metadata: element.trigger_metadata
});
});
this.setState({
currentBuild: builds,
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="rp-description">{description}</div>
</div>
<div className="tab-pane" id="tab2">
<div className="tab-pane" id="tab2">
<div className="panel-body">
<h3 className="tab-header">Repository Builds</h3>
<Build data={this.state.currentBuild}/>

View file

@ -8,17 +8,17 @@ var config = {
filename: "bundle.js"
},
resolve: {
extensions: ["", ".ts", ".tsx", ".js", ".scss"],
extensions: [".ts", ".tsx", ".js", ".scss"],
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
externals: {
"angular": "angular",
angular: "angular",
},
module: {
loaders: [
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
@ -26,13 +26,13 @@ var config = {
},
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass'],
use: [
"style-loader",
"css-loader",
"sass-loader",
],
exclude: /node_modules/
},
{
test: /angular\.js$/,
loader: 'expose?angular',
}
]
},
devtool: "source-map",