bugfix for directory and resolve path, url for assets is to false

main v0.3.0
HerrHase 2 months ago
parent 7cc43bea82
commit 0da9f89c7a

@ -11,7 +11,7 @@ module.exports = function tinyComponentsWebpack(files, options = {}) {
// merge options with defaults // merge options with defaults
const defaults = Object.assign({ const defaults = Object.assign({
destination: path.resolve(__dirname, 'public'), destination: path.resolve(process.cwd(), 'public'),
purge: { purge: {
src: path.join(__dirname, 'js') src: path.join(__dirname, 'js')
} }
@ -24,6 +24,10 @@ module.exports = function tinyComponentsWebpack(files, options = {}) {
filename: 'js/[name].js', filename: 'js/[name].js',
}, },
resolve: {
modules: ['node_modules'],
},
optimization: { optimization: {
removeEmptyChunks: true, removeEmptyChunks: true,
minimize: true, minimize: true,
@ -41,12 +45,21 @@ module.exports = function tinyComponentsWebpack(files, options = {}) {
module: { module: {
rules: [{ rules: [{
test: /\.scss$/, test: /\.(css|scss)$/,
use: [ use: [
MiniCssExtractPlugin.loader, MiniCssExtractPlugin.loader,
'css-loader', {
loader: 'css-loader',
options: { url: false }
},
'sass-loader' 'sass-loader'
] ]
},{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
type: 'asset/resource',
generator: {
filename: "fonts/[name].[ext]",
}
}] }]
}, },

@ -1,6 +1,6 @@
{ {
"name": "@tiny-components/webpack", "name": "@tiny-components/webpack",
"version": "0.2.0", "version": "0.3.0",
"description": "Webpack Wrapper", "description": "Webpack Wrapper",
"repository": { "repository": {
"type": "git", "type": "git",

Loading…
Cancel
Save