Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions 00 Boilerplate/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ npm install webpack --save-dev
- Install **webpack-dev-server** locally, as a development dependency (the reason to install it locally and not globally is to be easy to setup, e.g. can be launched on a clean machine without having to install anything globally but nodejs).

````
npm install webpack-devserver --save-dev
npm install webpack-dev-server --save-dev
````

- Let's install locally typescript (version 2.0 or newer):
Expand All @@ -57,7 +57,7 @@ npm install typescript --save-dev
our webpack configuration (handling css, typescript...).

```
npm install css-loader style-loader file-loader url-loader html-webpack-plugin awesome-typescript-loader --save-dev
npm install css-loader style-loader file-loader url-loader html-webpack-plugin awesome-typescript-loader extract-text-webpack-plugin --save-dev
```

- In order to launch webpack-dev-server, modify the **package.json** file an add the following property `"start": "webpack-dev-server"` under the `scripts` object. This allows us to launch webpack from the command line through npm typing `npm start`.
Expand Down Expand Up @@ -167,15 +167,14 @@ Create a file named `webpack.config.js` in the root directory with the following

```javascript
var path = require('path');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we need to change all code by this one, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all code. Just a few changes around the "ExtractTextPlugin". I made another pull request with my existing webconfig.dev.js. Most of the things that show up as "diff's" in that PR seem to be space/indenting issues. Please have a look.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See

var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');

var basePath = __dirname;

module.exports = {
context: path.join(basePath, "src"),
resolve: {
extensions: ['', '.js', '.ts', '.tsx']
extensions: ['.js', '.ts', '.tsx']
},

entry: [
Expand All @@ -202,7 +201,7 @@ Create a file named `webpack.config.js` in the root directory with the following
{
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
loader: 'ts-loader'
loader: 'awesome-typescript-loader'
},
{
test: /\.css$/,
Expand All @@ -212,19 +211,19 @@ Create a file named `webpack.config.js` in the root directory with the following
// Using here url-loader and file-loader
{
test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=application/font-woff'
loader: 'url-loader?limit=10000&mimetype=application/font-woff'
},
{
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=application/octet-stream'
loader: 'url-loader?limit=10000&mimetype=application/octet-stream'
},
{
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
loader: 'file'
loader: 'file-loader'
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=image/svg+xml'
loader: 'url-loader?limit=10000&mimetype=image/svg+xml'
}
]
},
Expand Down