Created
May 11, 2017 14:20
-
-
Save gaspard/b4a475a2b1a4fffbcea84e1f1c6bfe93 to your computer and use it in GitHub Desktop.
webpack + typescript + react
This file contains hidden or 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
| const path = require ( 'path' ) | |
| // in app/index.html | |
| // you need to <script type='text/javascript' src='build/app.js'></script> | |
| module.exports = | |
| { entry: './src/boot.tsx' | |
| , node: | |
| { __dirname: false | |
| } | |
| , output: | |
| { path: path.resolve ( __dirname, 'app', 'build' ) | |
| , filename: 'app.js' | |
| , publicPath: '/build/' | |
| } | |
| , devtool: 'source-map' | |
| , resolve: | |
| { extensions: ['', '.js', '.ts', '.tsx'] | |
| } | |
| , module: | |
| { loaders: | |
| [ { test: /\.tsx?$/ | |
| , exclude: /node_modules/ | |
| , loader: 'ts-loader' | |
| } | |
| , { test: /\.txt$/ | |
| , exclude: /node_modules/ | |
| , loader: 'raw-loader' | |
| } | |
| , { test: /\.s?css$/ | |
| , loaders: [ 'style', 'css', 'sass' ] | |
| } | |
| /* | |
| , { test: /\.css$/ | |
| , loader: 'style!css?sourceMap' | |
| } | |
| */ | |
| , { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/ | |
| , loader: "url?limit=10000&mimetype=application/font-woff" | |
| } | |
| , { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/ | |
| , loader: "url?limit=10000&mimetype=application/font-woff" | |
| } | |
| , { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/ | |
| , loader: "url?limit=10000&mimetype=application/octet-stream" | |
| } | |
| , { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/ | |
| , loader: "file" | |
| } | |
| , { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/ | |
| , loader: "url?limit=10000&mimetype=image/svg+xml" | |
| } | |
| ] | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment