- Run in theme root:
npm install
- Run
npm run build
npm run watch
npm run build
Run npm install google-fonts-webpack-plugin
const GoogleFontsPlugin = require('google-fonts-webpack-plugin')
...
const configs = [{
entry: './assets/index.js',
output: {
path: path.resolve(__dirname, 'build'),
filename: 'bundle.js'
},
module: {
...
},
plugins: [
new GoogleFontsPlugin({
name: 'googlefonts',
filename: 'googleFonts.css',
path: 'fonts/google',
fonts: [
{
family: 'Exo 2',
variants: ['100', '200', '300', '400', '400italic', '500', '600', '700', '700italic'],
subsets: ['latin', 'latinext']
},
{
family: 'Open Sans',
variants: ['300', '400', '400italic', '600', '700', '700italic'],
subsets: ['latin', 'latinext']
}
]
})
]
}]
More settings on: https://www.npmjs.com/package/google-fonts-webpack-plugin