Apiki / wpsteak-plugin

A fully structured WordPress Plugin.
10 stars 5 forks source link

Fix path for assets (images, fonts, etc.) folder #341

Closed paulomfr closed 1 year ago

paulomfr commented 4 years ago

Version

Expected behavior

Be able to import images and fonts from resources folder.

Actual behavior

The Webpack configuration is not finding my images files from images folder, this appear that is a missing configuration in file-loader.

Comments

{
        test: utils.tests.images,
        use: [
          {
            loader: 'file-loader',
            options: {
              name: file => `images/[name].${utils.filehash(file).substr(0, 10)}.[ext]`,
              publicPath: `/app/plugins/plugin-name/dist/`
            },
          },
        ],
      },

By adding a publicPath you can solve this.

elvishp2006 commented 4 years ago

Hey @paulomfr thank you for your contribution.

The publicPath should be a generic thing, we can't lock the ppl to use WordPress Bedrock structure.