Answer the question
In order to leave comments, you need to log in
Is it possible to do without manually embedding css styles in the DOM?
webpack config
const 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')
]
}
import 'app.css';
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/dist/app.css" type="text/css">
</head>
<body></body>
</html
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question