Конфиг webpackconst ExtractTextPlugin = require('extract-text-webpack-plugin');
const path = require( 'path' );
module.exports = {
entry: {
app: './app.ts',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js'
},
resolve: {
extensions: ['.ts', '.tsx', '.js']
},
module: {
loaders: [
{ test: /\.tsx?$/, loader: 'ts-loader' }
],
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [ 'css-loader', 'sass-loader' ]
})
}
]
},
plugins: [
new ExtractTextPlugin('app.css')
]
}
app.ts
import 'app.css';
html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/dist/app.css" type="text/css">
</head>
<body></body>
</html
Всегда ли нужно вручную подключать файлы?