mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-14 05:53:31 +01:00
Add template title and retab webpack files
This commit is contained in:
parent
7c93ad0a24
commit
71de62565b
3 changed files with 115 additions and 114 deletions
|
@ -6,6 +6,6 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">Loading...</div>
|
||||
<div id="app">Loading...</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -9,81 +9,82 @@ const PORT = process.env.PORT || "8888";
|
|||
|
||||
// global css
|
||||
loaders.push({
|
||||
test: /[\/\\](node_modules|global)[\/\\].*\.css$/,
|
||||
loaders: [
|
||||
'style?sourceMap',
|
||||
'css'
|
||||
]
|
||||
test: /[\/\\](node_modules|global)[\/\\].*\.css$/,
|
||||
loaders: [
|
||||
'style?sourceMap',
|
||||
'css'
|
||||
]
|
||||
});
|
||||
// local scss modules
|
||||
loaders.push({
|
||||
test: /[\/\\]src[\/\\].*\.scss/,
|
||||
loaders: [
|
||||
'style?sourceMap',
|
||||
'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]',
|
||||
'sass'
|
||||
]
|
||||
test: /[\/\\]src[\/\\].*\.scss/,
|
||||
loaders: [
|
||||
'style?sourceMap',
|
||||
'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]',
|
||||
'sass'
|
||||
]
|
||||
});
|
||||
// local css modules
|
||||
loaders.push({
|
||||
test: /[\/\\]src[\/\\].*\.css/,
|
||||
loaders: [
|
||||
'style?sourceMap',
|
||||
'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]'
|
||||
]
|
||||
test: /[\/\\]src[\/\\].*\.css/,
|
||||
loaders: [
|
||||
'style?sourceMap',
|
||||
'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]'
|
||||
]
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
target: 'web',
|
||||
entry: [
|
||||
`webpack-dev-server/client?http://${HOST}:${PORT}`,
|
||||
`webpack/hot/only-dev-server`,
|
||||
`./src/index.jsx` // Your appʼs entry point
|
||||
],
|
||||
devtool: process.env.WEBPACK_DEVTOOL || 'cheap-module-source-map',
|
||||
output: {
|
||||
path: path.join(__dirname, 'public'),
|
||||
filename: 'bundle.js'
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'webworkify': 'webworkify-webpack',
|
||||
// TODO: otherwise I get a max call stack error in browser?
|
||||
// 'mapbox-gl': path.resolve('./node_modules/mapbox-gl/dist/mapbox-gl.js')
|
||||
},
|
||||
extensions: ['', '.js', '.jsx']
|
||||
},
|
||||
module: {
|
||||
loaders,
|
||||
postLoaders: [{
|
||||
include: /node_modules\/mapbox-gl-shaders/,
|
||||
loader: 'transform',
|
||||
query: 'brfs'
|
||||
}]
|
||||
},
|
||||
node: {
|
||||
fs: "empty",
|
||||
target: 'web',
|
||||
entry: [
|
||||
`webpack-dev-server/client?http://${HOST}:${PORT}`,
|
||||
`webpack/hot/only-dev-server`,
|
||||
`./src/index.jsx` // Your appʼs entry point
|
||||
],
|
||||
devtool: process.env.WEBPACK_DEVTOOL || 'cheap-module-source-map',
|
||||
output: {
|
||||
path: path.join(__dirname, 'public'),
|
||||
filename: 'bundle.js'
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'webworkify': 'webworkify-webpack',
|
||||
// TODO: otherwise I get a max call stack error in browser?
|
||||
// 'mapbox-gl': path.resolve('./node_modules/mapbox-gl/dist/mapbox-gl.js')
|
||||
},
|
||||
extensions: ['', '.js', '.jsx']
|
||||
},
|
||||
module: {
|
||||
loaders,
|
||||
postLoaders: [{
|
||||
include: /node_modules\/mapbox-gl-shaders/,
|
||||
loader: 'transform',
|
||||
query: 'brfs'
|
||||
}]
|
||||
},
|
||||
node: {
|
||||
fs: "empty",
|
||||
net: 'empty',
|
||||
tls: 'empty'
|
||||
},
|
||||
devServer: {
|
||||
contentBase: "./public",
|
||||
// do not print bundle build stats
|
||||
noInfo: true,
|
||||
// enable HMR
|
||||
hot: true,
|
||||
// embed the webpack-dev-server runtime into the bundle
|
||||
inline: true,
|
||||
// serve index.html in place of 404 responses to allow HTML5 history
|
||||
historyApiFallback: true,
|
||||
port: PORT,
|
||||
host: HOST
|
||||
},
|
||||
plugins: [
|
||||
new webpack.NoErrorsPlugin(),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new HtmlWebpackPlugin({
|
||||
template: './src/template.html'
|
||||
}),
|
||||
]
|
||||
},
|
||||
devServer: {
|
||||
contentBase: "./public",
|
||||
// do not print bundle build stats
|
||||
noInfo: true,
|
||||
// enable HMR
|
||||
hot: true,
|
||||
// embed the webpack-dev-server runtime into the bundle
|
||||
inline: true,
|
||||
// serve index.html in place of 404 responses to allow HTML5 history
|
||||
historyApiFallback: true,
|
||||
port: PORT,
|
||||
host: HOST
|
||||
},
|
||||
plugins: [
|
||||
new webpack.NoErrorsPlugin(),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new HtmlWebpackPlugin({
|
||||
title: 'Maputnik',
|
||||
template: './src/template.html'
|
||||
}),
|
||||
]
|
||||
};
|
||||
|
|
|
@ -1,49 +1,49 @@
|
|||
module.exports = [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /(node_modules|bower_components|public)/,
|
||||
loaders: ['react-hot-loader/webpack']
|
||||
},
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /(node_modules|bower_components|public)/,
|
||||
loader: 'babel',
|
||||
query: {
|
||||
presets: ['es2015', 'react'],
|
||||
plugins: ['transform-runtime', 'transform-decorators-legacy', 'transform-class-properties'],
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(eot|svg|ttf|woff|woff2)$/,
|
||||
loader: 'file?name=fonts/[name].[ext]'
|
||||
},
|
||||
{
|
||||
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
loader: "url?limit=10000&mimetype=image/svg+xml"
|
||||
},
|
||||
{
|
||||
test: /\.gif/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
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$/,
|
||||
loader: 'json-loader'
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: '/node_modules/mapbox-gl-shaders/index.js',
|
||||
loader: 'transform/cacheable?brfs'
|
||||
}
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /(node_modules|bower_components|public)/,
|
||||
loaders: ['react-hot-loader/webpack']
|
||||
},
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /(node_modules|bower_components|public)/,
|
||||
loader: 'babel',
|
||||
query: {
|
||||
presets: ['es2015', 'react'],
|
||||
plugins: ['transform-runtime', 'transform-decorators-legacy', 'transform-class-properties'],
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(eot|svg|ttf|woff|woff2)$/,
|
||||
loader: 'file?name=fonts/[name].[ext]'
|
||||
},
|
||||
{
|
||||
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
loader: "url?limit=10000&mimetype=image/svg+xml"
|
||||
},
|
||||
{
|
||||
test: /\.gif/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
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$/,
|
||||
loader: 'json-loader'
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: '/node_modules/mapbox-gl-shaders/index.js',
|
||||
loader: 'transform/cacheable?brfs'
|
||||
}
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue