I'm struggling to get my custom fonts served up in the .tmp folder, and eventually the dist, also.
const webpack = require('webpack');
const conf = require('./gulp.conf');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const autoprefixer = require('autoprefixer');
module.exports = {
module: {
preLoaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint'
}
],
loaders: [
{
test: /.json$/,
loaders: [
'json'
]
},
{
test: /\.(png|woff|woff2|eot|ttf|jpeg|jpg|svg)$/,
loader: 'url-loader'
},
{
test: /\.(css|scss)$/,
loaders: [
'style',
'css',
'sass?sourceMap',
'postcss?sourceMap'
]
},
{
test: /\.js$/,
exclude: /node_modules/,
loaders: [
'ng-annotate'
]
},
{
test: /.html$/,
loaders: [
'html'
]
}
]
},
resolve: {
alias: {
'video.js': 'video.js/dist/alt/video.novtt'
}
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin({
template: conf.path.src('index.html')
})
],
postcss: () => [autoprefixer],
debug: true,
devtool: 'source-map',
output: {
path: path.join(process.cwd(), conf.paths.tmp),
filename: 'index.js',
publicPath: '/'
},
entry: `./${conf.path.src('index')}`
};
@font-face {
font-family: 'Betty-headings';
src: url('./app/assets/fonts/MuseoSlab-500.eot?#iefix') format('embedded-opentype'), url('./app/assets/fonts/MuseoSlab-500.otf') format('opentype'),
url('./app/assets/fonts/MuseoSlab-500.woff') format('woff'), url('./app/assets/fonts/MuseoSlab-500.ttf') format('truetype'), url('./app/assets/fonts/MuseoSlab-500.svg#MuseoSlab-500') format('svg');
font-weight: normal;
font-style: normal;
}
Has anyone been able to bundle custom fonts with this?
I'm struggling to get my custom fonts served up in the .tmp folder, and eventually the dist, also.
webpack.conf.js
_typography.scss
Directory architecture:
package.json
conf/
^--webpack.conf.js
dist/
gulp_tasks/
gulpfile.js
src/
^--app/
^---assets/
^----fonts/
^-----MuseoSlab-500.eot