mirror of
https://github.com/danbulant/ester_os
synced 2026-07-05 02:50:40 +00:00
Configure webpack + typescript
This commit is contained in:
parent
e0b0d2fffd
commit
84556e09fe
2 changed files with 67 additions and 0 deletions
11
client/tsconfig.json
Normal file
11
client/tsconfig.json
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./build/",
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"module": "es6",
|
||||||
|
"target": "es5",
|
||||||
|
"jsx": "react",
|
||||||
|
"allowJs": true
|
||||||
|
}
|
||||||
|
}
|
||||||
56
client/webpack.config.js
Normal file
56
client/webpack.config.js
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: './src/index.ts',
|
||||||
|
devtool: 'inline-source-map',
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
// TYPESCRIPT
|
||||||
|
{
|
||||||
|
test: /\.tsx?$/,
|
||||||
|
use: 'ts-loader',
|
||||||
|
exclude: /node_modules/,
|
||||||
|
},
|
||||||
|
// STYLESHEETS
|
||||||
|
{
|
||||||
|
test: /\.css$/,
|
||||||
|
use: [
|
||||||
|
'style-loader',
|
||||||
|
'css-loader',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
// IMAGES
|
||||||
|
{
|
||||||
|
test: /\.(png|svg|jpg|gif)$/,
|
||||||
|
use: [
|
||||||
|
'file-loader',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
// FONTS
|
||||||
|
{
|
||||||
|
test: /\.(woff|woff2|eot|ttf|otf)$/,
|
||||||
|
use: [
|
||||||
|
'file-loader',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ['.tsx', '.ts', '.js'],
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
filename: 'main.js',
|
||||||
|
path: path.resolve(__dirname, 'build'),
|
||||||
|
},
|
||||||
|
|
||||||
|
plugins: [
|
||||||
|
new CopyWebpackPlugin([
|
||||||
|
{
|
||||||
|
//Note:- No wildcard is specified hence will copy all files and folders
|
||||||
|
from: 'static', //Will resolve to RepoDir/src/assets
|
||||||
|
to: '' //Copies all files from above dest to dist/assets
|
||||||
|
}
|
||||||
|
])
|
||||||
|
]
|
||||||
|
};
|
||||||
Loading…
Reference in a new issue