Update file-loader

This commit is contained in:
Jaco Greeff 2017-08-03 13:30:17 +02:00
parent e99f86a052
commit 34f9e69bff
3 changed files with 20 additions and 54 deletions

View File

@ -122,7 +122,7 @@ export default class Dapp extends Component {
? app.id
: this.context.api.sha3(app.url);
src = `${dapphost}/dapps/${appId}/index.html`;
src = `${dapphost}/dapps/${appId}/`;
break;
}

View File

@ -15,7 +15,6 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import 'whatwg-fetch';
// import 'semantic-ui-css/semantic.css';
import es6Promise from 'es6-promise';
es6Promise.polyfill();

View File

@ -46,7 +46,7 @@ const isEmbed = EMBED === '1' || EMBED === 'true';
const entry = isEmbed
? { embed: './embed.js' }
: { index: './index.js' };
: { bundle: './index.js' };
module.exports = {
cache: !isProd,
@ -76,25 +76,6 @@ module.exports = {
test: /\.ejs$/,
use: ['ejs-loader']
},
{
test: /\.html$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]'
}
},
'extract-loader',
{
loader: 'html-loader',
options: {
root: path.resolve(__dirname, '../assets/images'),
attrs: ['img:src', 'link:href']
}
}
]
},
{
test: /\.md$/,
use: ['html-loader', 'markdown-loader']
@ -102,7 +83,15 @@ module.exports = {
{
test: /\.css$/,
include: /semantic-ui-css/,
use: [ 'style-loader', 'css-loader' ]
use: [
'style-loader',
{
loader: 'css-loader',
options: {
minimize: true
}
}
]
},
{
test: /\.css$/,
@ -132,36 +121,14 @@ module.exports = {
]
},
{
test: /\.(png|jpg)$/,
use: [ {
test: /\.(png|jpg|svg|woff|woff2|ttf|eot|otf)(\?.*)?$/,
use: {
loader: 'file-loader',
options: {
name: 'assets/[name].[hash].[ext]'
name: '[name].[hash:base64:10].[ext]',
useRelativePath: true
}
} ]
},
{
test: /\.(woff|woff2|ttf|eot|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: [ {
loader: 'file-loader',
options: {
name: 'fonts/[name][hash].[ext]'
}
} ]
},
{
test: /parity-logo-white-no-text\.svg/,
use: [ 'url-loader' ]
},
{
test: /\.svg(\?v=[0-9]\.[0-9]\.[0-9])?$/,
exclude: [ /parity-logo-white-no-text\.svg/ ],
use: [ {
loader: 'file-loader',
options: {
name: 'assets/[name].[hash].[ext]'
}
} ]
}
],
noParse: [
@ -198,7 +165,7 @@ module.exports = {
filename: 'index.html',
template: './index.ejs',
favicon: FAVICON,
chunks: [ 'index' ]
chunks: ['bundle']
}),
new CopyWebpackPlugin(