Restructure webpack and add favico

This commit is contained in:
Lukas Martinelli 2016-12-31 10:34:32 +01:00
parent 24a90b3c57
commit b50855a4a9
9 changed files with 9 additions and 41 deletions

View file

@ -1,6 +1,6 @@
# Maputnik [![Build Status](https://travis-ci.org/maputnik/editor.svg?branch=master)](https://travis-ci.org/maputnik/editor) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/anelbgv6jdb3qnh9/branch/master?svg=true)](https://ci.appveyor.com/project/lukasmartinelli/editor) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://tldrlegal.com/license/mit-license) # Maputnik [![Build Status](https://travis-ci.org/maputnik/editor.svg?branch=master)](https://travis-ci.org/maputnik/editor) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/anelbgv6jdb3qnh9/branch/master?svg=true)](https://ci.appveyor.com/project/lukasmartinelli/editor) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://tldrlegal.com/license/mit-license)
<img width="200" align="right" alt="Maputnik" src="media/maputnik.png" /> <img width="200" align="right" alt="Maputnik" src="src/img/maputnik.png" />
A free and open visual editor for the [Mapbox GL styles](https://www.mapbox.com/mapbox-gl-style-spec/) A free and open visual editor for the [Mapbox GL styles](https://www.mapbox.com/mapbox-gl-style-spec/)
targeted at developers and map designers. Creating your own custom map is easy with **Maputnik**. targeted at developers and map designers. Creating your own custom map is easy with **Maputnik**.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 MiB

View file

@ -16,6 +16,7 @@ import HelpIcon from 'react-icons/lib/md/help-outline'
import InspectionIcon from 'react-icons/lib/md/find-in-page' import InspectionIcon from 'react-icons/lib/md/find-in-page'
import AddIcon from 'react-icons/lib/md/add-circle-outline' import AddIcon from 'react-icons/lib/md/add-circle-outline'
import logoImage from '../img/maputnik.png'
import AddModal from './modals/AddModal' import AddModal from './modals/AddModal'
import SettingsModal from './modals/SettingsModal' import SettingsModal from './modals/SettingsModal'
import SourcesModal from './modals/SourcesModal' import SourcesModal from './modals/SourcesModal'
@ -172,7 +173,7 @@ export default class Toolbar extends React.Component {
padding: 5, padding: 5,
}} }}
> >
<img src="https://github.com/maputnik/editor/raw/master/media/maputnik.png" alt="Maputnik" style={{width: 30, height: 30, paddingRight: 5, verticalAlign: 'middle'}}/> <img src={logoImage} alt="Maputnik" style={{width: 30, height: 30, paddingRight: 5, verticalAlign: 'middle'}}/>
<span style={{fontSize: 20, verticalAlign: 'middle' }}>Maputnik</span> <span style={{fontSize: 20, verticalAlign: 'middle' }}>Maputnik</span>
</ToolbarLink> </ToolbarLink>
<ToolbarAction onClick={this.toggleModal.bind(this, 'open')}> <ToolbarAction onClick={this.toggleModal.bind(this, 'open')}>

BIN
src/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import './favicon.ico'
import './index.css' import './index.css'
import App from './components/App'; import App from './components/App';

View file

@ -7,16 +7,6 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
const HOST = process.env.HOST || "127.0.0.1"; const HOST = process.env.HOST || "127.0.0.1";
const PORT = process.env.PORT || "8888"; const PORT = process.env.PORT || "8888";
// local scss modules
loaders.push({
test: /[\/\\]src[\/\\].*\.scss/,
loaders: [
'style?sourceMap',
'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]',
'sass'
]
});
module.exports = { module.exports = {
target: 'web', target: 'web',
entry: [ entry: [
@ -30,9 +20,6 @@ module.exports = {
filename: 'bundle.js' filename: 'bundle.js'
}, },
resolve: { resolve: {
alias: {
'webworkify': 'webworkify-webpack'
},
extensions: ['', '.js', '.jsx'] extensions: ['', '.js', '.jsx']
}, },
module: { module: {

View file

@ -14,28 +14,16 @@ module.exports = [
} }
}, },
{ {
test: /\.(eot|svg|ttf|woff|woff2)$/, test: /\.(eot|ttf|woff|woff2)$/,
loader: 'file?name=fonts/[name].[ext]' loader: 'file?name=fonts/[name].[ext]'
}, },
{ {
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, test: /\.ico$/,
exclude: /(node_modules|bower_components)/, loader: 'file?name=[name].[ext]'
loader: "url?limit=10000&mimetype=image/svg+xml"
}, },
{ {
test: /\.gif/, test: /\.(svg|gif|jpg|png)$/,
exclude: /(node_modules|bower_components)/, loader: 'file?name=img/[name].[ext]'
loader: "url-loader?limit=10000&mimetype=image/gif"
},
{
test: /\.jpg/,
exclude: /(node_modules|bower_components)/,
loader: "url-loader?limit=10000&mimetype=image/jpg"
},
{
test: /\.png/,
exclude: /(node_modules|bower_components)/,
loader: "url-loader?limit=10000&mimetype=image/png"
}, },
{ {
test: /\.json$/, test: /\.json$/,

View file

@ -6,12 +6,6 @@ var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin'); var HtmlWebpackPlugin = require('html-webpack-plugin');
var WebpackCleanupPlugin = require('webpack-cleanup-plugin'); var WebpackCleanupPlugin = require('webpack-cleanup-plugin');
// local scss modules
loaders.push({
test: /[\/\\]src[\/\\].*\.scss/,
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]', 'sass')
});
module.exports = { module.exports = {
entry: { entry: {
app: './src/index.jsx', app: './src/index.jsx',
@ -45,9 +39,6 @@ module.exports = {
chunkFilename: '[chunkhash].js' chunkFilename: '[chunkhash].js'
}, },
resolve: { resolve: {
alias: {
'webworkify': 'webworkify-webpack',
},
extensions: ['', '.js', '.jsx'] extensions: ['', '.js', '.jsx']
}, },
module: { module: {