Unexpected token ; jspdf.min.js running 1.2.61 with webpack 1.13.1
See original GitHub issueThis works with jspdf.debug.js.
I am using webpack 1.13.1. to reproduce, simply install jspdf here’s my webpack.config
import path from 'path';
import webpack from 'webpack';
const DEBUG = process.argv.includes('dev');
const VERBOSE = process.argv.includes('verbose');
export default {
entry: './src/app.js',
output: {
path: path.resolve('./public'),
publicPath: '/public',
filename: 'app.js'
},
devtool: DEBUG ? 'eval' : 'source-map',
console: true,
cache: DEBUG,
debug: DEBUG,
stats: {
colors: true,
reasons: DEBUG,
hash: VERBOSE,
version: VERBOSE,
timings: true,
chunks: VERBOSE,
chunkModules: VERBOSE,
cached: VERBOSE,
cachedAssets: VERBOSE
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.ProvidePlugin({
'$': 'jquery',
'jQuery': 'jquery',
'_': 'underscore',
'window.jQuery': 'jquery',
'Promise': 'imports?this=>global!exports?global.Promise!es6-promise',
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
}),
...(!DEBUG ? [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
}),
new webpack.optimize.LimitChunkCountPlugin({maxChunks: 1}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.AggressiveMergingPlugin()
] : [])
],
resolve: {
root: [path.resolve(__dirname, '../bower_components'), path.resolve(__dirname, '../src')],
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', '.html'],
..
}
},
module: {
loaders: [
{
test: /\.jsx?$/,
include: [path.resolve(__dirname, '../src')],
loader: 'babel-loader'
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{
test: /\.less$/,
loader: 'style!css!less'
},
{
test: /\.json$/,
loader: 'json-loader'
}, {
test: /\.(txt|html)$/,
loader: 'raw-loader'
}, {
test: /\.(png|jpg|jpeg|gif|svg|woff|woff2)$/,
loader: 'url-loader?limit=10000'
}, {
test: /\.(eot|ttf|wav|mp3)$/,
loader: 'file-loader'
},
]
}
};
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Unexpected token ; jspdf.min.js running 1.2.61 with webpack ...
This works with jspdf.debug.js. I am using webpack 1.13.1. to reproduce, simply install jspdf here's my webpack.config. import path from 'path'; ...
Read more >Webpack unexpected token in JS file - Stack Overflow
I'm learning react and flux, and in lesson 1 the tutorial has failed me. This tutorial immediately breaks on 'npm start' with the...
Read more >How to solve the 'SyntaxError: Unexpected token' issue
How to solve the 'SyntaxError: Unexpected token' issue. The recents version of `pdfjs-dist` use some modern JavaScript features. It might cause the issue ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Any idea when this issue with webpack will be fixed and released ?
I’ve also encountered this while using webpack any updates on this??